diff options
author | Denis Vlasenko | 2008-07-01 15:59:42 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-07-01 15:59:42 +0000 |
commit | 82604e973085f91f1b99cacea08963d0d1468084 (patch) | |
tree | 2de05bb2a6943ca6be0cc46f36e5fb07099aef40 /libbb/vfork_daemon_rexec.c | |
parent | b111917972c1398ef96ef2d388c6c4ba57a8e9f7 (diff) | |
download | busybox-82604e973085f91f1b99cacea08963d0d1468084.zip busybox-82604e973085f91f1b99cacea08963d0d1468084.tar.gz |
revert last two commits. vfork cannot be used in subroutine,
it trashes stack on return
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index 989e9b8..37d4c27 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c @@ -226,7 +226,9 @@ void FAST_FUNC forkexit_or_rexec(char **argv) if (re_execed) return; - pid = xvfork(); + pid = vfork(); + if (pid < 0) /* wtf? */ + bb_perror_msg_and_die("vfork"); if (pid) /* parent */ exit(EXIT_SUCCESS); /* child - re-exec ourself */ @@ -238,7 +240,9 @@ void FAST_FUNC forkexit_or_rexec(char **argv) void FAST_FUNC forkexit_or_rexec(void) { pid_t pid; - pid = xfork(); + pid = fork(); + if (pid < 0) /* wtf? */ + bb_perror_msg_and_die("fork"); if (pid) /* parent */ exit(EXIT_SUCCESS); /* child */ |