diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-12-17 09:48:16 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-12-17 09:48:16 +0000 |
commit | cf1fee06a5e4b18b97f9b279694baae403d7289b (patch) | |
tree | f31c5eccb319ce14d21ee30aca71be455ff3e50f | |
parent | be2ae246fb69d903a492adaed7e3b476c7133718 (diff) | |
download | busybox-cf1fee06a5e4b18b97f9b279694baae403d7289b.tar.gz |
Odd. I never brought this forward from bb.stable. Should handle
reaping child processes better.
-Erik
-rw-r--r-- | init/init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c index bb1f383b3..91a19c5d1 100644 --- a/init/init.c +++ b/init/init.c @@ -1141,7 +1141,7 @@ extern int init_main(int argc, char **argv) /* Wait for a child process to exit */ wpid = wait(&status); - if (wpid > 0) { + while (wpid > 0) { /* Find out who died and clean up their corpse */ for (a = init_action_list; a; a = a->next) { if (a->pid == wpid) { @@ -1152,6 +1152,8 @@ extern int init_main(int argc, char **argv) "Scheduling it for restart.\n", a->command, wpid); } } + /* see if anyone else is waiting to be reaped */ + wpid = waitpid (-1, &status, WNOHANG); } } } |