summaryrefslogtreecommitdiffhomepage
path: root/libbb
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-16 16:35:53 +0000
committerRob Landley <rob@landley.net>2006-06-16 16:35:53 +0000
commitd9a761d9c3ed1ec9143b2327a5212574d115e29f (patch)
tree189114865f4273ddad92855a7828a5af5f9269fa /libbb
parent1449a2014a4e715a7a52b27caec528a9c802fa5f (diff)
Revert svn 15333. If you vfork, you must either exec or exit. (The parent is
blocked until you do so.)
Diffstat (limited to 'libbb')
-rw-r--r--libbb/vfork_daemon_rexec.c24
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";