diff options
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index 409e8c41f..4b543a44f 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -369,7 +369,8 @@ static pid_t run(const struct init_action *a) | |||
369 | if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) { | 369 | if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) { |
370 | 370 | ||
371 | /* Now fork off another process to just hang around */ | 371 | /* Now fork off another process to just hang around */ |
372 | if ((pid = fork()) < 0) { | 372 | pid = fork(); |
373 | if (pid) { | ||
373 | message(L_LOG | L_CONSOLE, "Can't fork"); | 374 | message(L_LOG | L_CONSOLE, "Can't fork"); |
374 | _exit(1); | 375 | _exit(1); |
375 | } | 376 | } |
@@ -388,7 +389,8 @@ static pid_t run(const struct init_action *a) | |||
388 | _exit(0); | 389 | _exit(0); |
389 | 390 | ||
390 | /* Use a temporary process to steal the controlling tty. */ | 391 | /* Use a temporary process to steal the controlling tty. */ |
391 | if ((pid = fork()) < 0) { | 392 | pid = fork(); |
393 | if (pid < 0) { | ||
392 | message(L_LOG | L_CONSOLE, "Can't fork"); | 394 | message(L_LOG | L_CONSOLE, "Can't fork"); |
393 | _exit(1); | 395 | _exit(1); |
394 | } | 396 | } |