diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index 05c9c0dab..59a2287b0 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c @@ -23,9 +23,12 @@ #ifdef BB_NOMMU -static void vfork_daemon_common(int nochdir, int noclose) +void vfork_daemon_rexec(int nochdir, int noclose, + int argc, char **argv, char *foreground_opt) { int fd; + char **vfork_args; + int a = 0; setsid(); @@ -38,24 +41,7 @@ static void vfork_daemon_common(int nochdir, int noclose) dup2(fd, STDERR_FILENO); if (fd > 2) close(fd); - } -} - -void vfork_daemon(int nochdir, int noclose) -{ - vfork_daemon_common(nochdir, noclose); - - if (vfork()) - exit(0); -} - -void vfork_daemon_rexec(int nochdir, int noclose, - int argc, char **argv, char *foreground_opt) -{ - char **vfork_args; - int a = 0; - - vfork_daemon_common(nochdir, noclose); + } vfork_args = xcalloc(sizeof(char *), argc + 3); vfork_args[a++] = "/bin/busybox"; |