summaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-26 13:35:09 +0000
committerDenis Vlasenko2007-03-26 13:35:09 +0000
commit53091ecd20c294f0e0757a5f4e0d5c8c7b23b555 (patch)
treef4ae0be26d5debff091d2c976e77fa8050c6758c /libbb/vfork_daemon_rexec.c
parentec1a4b5a521b5adf295bc757c25231910f8c854b (diff)
downloadbusybox-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.zip
busybox-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.tar.gz
Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far (yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO Also make fork(), daemon() produce warnings on compile stage (in addition to erros on link stage).
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index c59b0b6..89ae9a7 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -115,7 +115,7 @@ void vfork_daemon_rexec(int nochdir, int noclose, char **argv)
#endif /* BB_NOMMU */
#ifdef BB_NOMMU
-static void daemon_or_rexec(char **argv)
+void forkexit_or_rexec(char **argv)
{
pid_t pid;
/* Maybe we are already re-execed and come here again? */
@@ -135,7 +135,9 @@ static void daemon_or_rexec(char **argv)
bb_perror_msg_and_die("exec %s", CONFIG_BUSYBOX_EXEC_PATH);
}
#else
-static void daemon_or_rexec(void)
+/* Dance around (void)...*/
+#undef forkexit_or_rexec
+void forkexit_or_rexec(void)
{
pid_t pid;
pid = fork();
@@ -145,7 +147,7 @@ static void daemon_or_rexec(void)
exit(0);
/* child */
}
-#define daemon_or_rexec(argv) daemon_or_rexec()
+#define forkexit_or_rexec(argv) forkexit_or_rexec()
#endif
@@ -170,7 +172,7 @@ void bb_daemonize_or_rexec(int flags, char **argv)
fd = dup(fd); /* have 0,1,2 open at least to /dev/null */
if (!(flags & DAEMON_ONLY_SANITIZE)) {
- daemon_or_rexec(argv);
+ forkexit_or_rexec(argv);
/* if daemonizing, make sure we detach from stdio */
setsid();
dup2(fd, 0);