diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-01 15:59:42 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-01 15:59:42 +0000 |
commit | 82604e973085f91f1b99cacea08963d0d1468084 (patch) | |
tree | 2de05bb2a6943ca6be0cc46f36e5fb07099aef40 /libbb/vfork_daemon_rexec.c | |
parent | b111917972c1398ef96ef2d388c6c4ba57a8e9f7 (diff) | |
download | busybox-w32-82604e973085f91f1b99cacea08963d0d1468084.tar.gz busybox-w32-82604e973085f91f1b99cacea08963d0d1468084.tar.bz2 busybox-w32-82604e973085f91f1b99cacea08963d0d1468084.zip |
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 989e9b841..37d4c274e 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) | |||
226 | if (re_execed) | 226 | if (re_execed) |
227 | return; | 227 | return; |
228 | 228 | ||
229 | pid = xvfork(); | 229 | pid = vfork(); |
230 | if (pid < 0) /* wtf? */ | ||
231 | bb_perror_msg_and_die("vfork"); | ||
230 | if (pid) /* parent */ | 232 | if (pid) /* parent */ |
231 | exit(EXIT_SUCCESS); | 233 | exit(EXIT_SUCCESS); |
232 | /* child - re-exec ourself */ | 234 | /* child - re-exec ourself */ |
@@ -238,7 +240,9 @@ void FAST_FUNC forkexit_or_rexec(char **argv) | |||
238 | void FAST_FUNC forkexit_or_rexec(void) | 240 | void FAST_FUNC forkexit_or_rexec(void) |
239 | { | 241 | { |
240 | pid_t pid; | 242 | pid_t pid; |
241 | pid = xfork(); | 243 | pid = fork(); |
244 | if (pid < 0) /* wtf? */ | ||
245 | bb_perror_msg_and_die("fork"); | ||
242 | if (pid) /* parent */ | 246 | if (pid) /* parent */ |
243 | exit(EXIT_SUCCESS); | 247 | exit(EXIT_SUCCESS); |
244 | /* child */ | 248 | /* child */ |