← Commit list

f6ccc62c7

Denis Vlasenko
Denis Vlasenko
2007-11-10
FAILED Duration: 12s

Subject

init: fix bug 1584: improper check for fork error

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

init/init.c+1 -2
@@ -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);