← Commit list

21e20cb4a

Denis Vlasenko
Denis Vlasenko
2008-01-04
FAILED Duration: 12s

Subject

init: wait for orphaned children too while waiting for sysinit-like processes (Harald Küthe )

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+9 -3
@@ -97,10 +97,16 @@ static const char *const environment[] = {
static void delete_init_action(struct init_action *a);
static void halt_reboot_pwoff(int sig) ATTRIBUTE_NORETURN;
-/* TODO: move to libbb? */
-static int waitfor(pid_t runpid)
+static void waitfor(pid_t pid)
{
- return safe_waitpid(runpid, NULL, 0);
+ /* waitfor(run(x)): protect against failed fork inside run() */
+ if (pid <= 0)
+ return;
+
+ /* Wait for any child (prevent zombies from exiting orphaned processes)
+ * but exit the loop only when specified one has exited. */
+ while (wait(NULL) != pid)
+ continue;
}
static void loop_forever(void) ATTRIBUTE_NORETURN;