From: Denis Vlasenko Date: Sat, 10 Nov 2007 01:57:35 +0000 (-0000) Subject: init: fix bug 1584: improper check for fork error X-Git-Tag: 1_9_0~119 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f6ccc62c70f69376ecf0098ed1944b31722e0d53;p=oweals%2Fbusybox.git init: fix bug 1584: improper check for fork error --- 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) /* Now fork off another process to just hang around */ pid = fork(); - if (pid) { + if (pid < 0) { message(L_LOG | L_CONSOLE, "Can't fork"); _exit(1); } if (pid > 0) { - /* We are the parent -- wait till the child is done */ signal(SIGINT, SIG_IGN); signal(SIGTSTP, SIG_IGN);