diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-10 01:57:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-10 01:57:35 +0000 |
commit | f6ccc62c70f69376ecf0098ed1944b31722e0d53 (patch) | |
tree | 68e20cdb3de76f6276bc18258d8ec78e13762d7a /init/init.c | |
parent | 5cc6459c46a935dc54f28f85abd2797b4bcc2559 (diff) | |
download | busybox-w32-f6ccc62c70f69376ecf0098ed1944b31722e0d53.tar.gz busybox-w32-f6ccc62c70f69376ecf0098ed1944b31722e0d53.tar.bz2 busybox-w32-f6ccc62c70f69376ecf0098ed1944b31722e0d53.zip |
init: fix bug 1584: improper check for fork error
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index 4b543a44f..9891087f5 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -370,13 +370,12 @@ static pid_t run(const struct init_action *a) | |||
370 | 370 | ||
371 | /* Now fork off another process to just hang around */ | 371 | /* Now fork off another process to just hang around */ |
372 | pid = fork(); | 372 | pid = fork(); |
373 | if (pid) { | 373 | if (pid < 0) { |
374 | message(L_LOG | L_CONSOLE, "Can't fork"); | 374 | message(L_LOG | L_CONSOLE, "Can't fork"); |
375 | _exit(1); | 375 | _exit(1); |
376 | } | 376 | } |
377 | 377 | ||
378 | if (pid > 0) { | 378 | if (pid > 0) { |
379 | |||
380 | /* We are the parent -- wait till the child is done */ | 379 | /* We are the parent -- wait till the child is done */ |
381 | signal(SIGINT, SIG_IGN); | 380 | signal(SIGINT, SIG_IGN); |
382 | signal(SIGTSTP, SIG_IGN); | 381 | signal(SIGTSTP, SIG_IGN); |