summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2007-11-10 01:57:35 +0000
committerDenis Vlasenko2007-11-10 01:57:35 +0000
commitf6ccc62c70f69376ecf0098ed1944b31722e0d53 (patch)
tree68e20cdb3de76f6276bc18258d8ec78e13762d7a
parent5cc6459c46a935dc54f28f85abd2797b4bcc2559 (diff)
downloadbusybox-f6ccc62c70f69376ecf0098ed1944b31722e0d53.zip
busybox-f6ccc62c70f69376ecf0098ed1944b31722e0d53.tar.gz
init: fix bug 1584: improper check for fork error
-rw-r--r--init/init.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c
index 4b543a4..9891087 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);