Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
goto dump;
}
/* parent */
+ USE_FOR_NOMMU(argv[-optind][0] &= 0x7f); /* undo fork_or_rexec() damage */
xchdir(*argv++);
close(pp.wr);
xmove_fd(pp.rd, STDIN_FILENO);
# define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus)
#else
extern bool re_execed;
+ /* Note: re_exec() and fork_or_rexec() do argv[0][0] |= 0x80 on NOMMU!
+ * _Parent_ needs to undo it if it doesn't want to have argv[0] mangled.
+ */
void re_exec(char **argv) NORETURN FAST_FUNC;
pid_t fork_or_rexec(char **argv) FAST_FUNC;
int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC;
/* parent */
+ USE_FOR_NOMMU(argv[0][0] &= 0x7f); /* undo fork_or_rexec() damage */
+
if (DO_SIGNAL_SYNC) {
/* Wait for logger child to set handlers, then unpause it.
* Otherwise with short-lived PROG (e.g. "bootchartd start true")
/* Run a copy of ourself in inetd mode */
re_exec(argv_copy);
}
+ argv_copy[0][0] &= 0x7f;
/* parent, or vfork failed */
close(n);
} /* while (1) */