make standalone httpd work on NOMMU machines
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index f7c6209..558510b 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -203,6 +203,15 @@
}
#if !BB_MMU
+void re_exec(char **argv)
+{
+ /* high-order bit of first char in argv[0] is a hidden
+ * "we have (already) re-execed, don't do it again" flag */
+ argv[0][0] |= 0x80;
+ execv(bb_busybox_exec_path, argv);
+ bb_perror_msg_and_die("exec %s", bb_busybox_exec_path);
+}
+
void forkexit_or_rexec(char **argv)
{
pid_t pid;
@@ -216,11 +225,7 @@
if (pid) /* parent */
exit(0);
/* child - re-exec ourself */
- /* high-order bit of first char in argv[0] is a hidden
- * "we have (alrealy) re-execed, don't do it again" flag */
- argv[0][0] |= 0x80;
- execv(bb_busybox_exec_path, argv);
- bb_perror_msg_and_die("exec %s", bb_busybox_exec_path);
+ re_exec(argv);
}
#else
/* Dance around (void)...*/