Odd. I never brought this forward from bb.stable. Should handle
reaping child processes better. -Erik
This commit is contained in:
parent
be2ae246fb
commit
cf1fee06a5
@ -1141,7 +1141,7 @@ extern int init_main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Wait for a child process to exit */
|
/* Wait for a child process to exit */
|
||||||
wpid = wait(&status);
|
wpid = wait(&status);
|
||||||
if (wpid > 0) {
|
while (wpid > 0) {
|
||||||
/* Find out who died and clean up their corpse */
|
/* Find out who died and clean up their corpse */
|
||||||
for (a = init_action_list; a; a = a->next) {
|
for (a = init_action_list; a; a = a->next) {
|
||||||
if (a->pid == wpid) {
|
if (a->pid == wpid) {
|
||||||
@ -1152,6 +1152,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
"Scheduling it for restart.\n", a->command, wpid);
|
"Scheduling it for restart.\n", a->command, wpid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* see if anyone else is waiting to be reaped */
|
||||||
|
wpid = waitpid (-1, &status, WNOHANG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user