diff options
Diffstat (limited to 'init/init.c')
-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) | |||
1141 | 1141 | ||
1142 | /* Wait for a child process to exit */ | 1142 | /* Wait for a child process to exit */ |
1143 | wpid = wait(&status); | 1143 | wpid = wait(&status); |
1144 | if (wpid > 0) { | 1144 | while (wpid > 0) { |
1145 | /* Find out who died and clean up their corpse */ | 1145 | /* Find out who died and clean up their corpse */ |
1146 | for (a = init_action_list; a; a = a->next) { | 1146 | for (a = init_action_list; a; a = a->next) { |
1147 | if (a->pid == wpid) { | 1147 | if (a->pid == wpid) { |
@@ -1152,6 +1152,8 @@ extern int init_main(int argc, char **argv) | |||
1152 | "Scheduling it for restart.\n", a->command, wpid); | 1152 | "Scheduling it for restart.\n", a->command, wpid); |
1153 | } | 1153 | } |
1154 | } | 1154 | } |
1155 | /* see if anyone else is waiting to be reaped */ | ||
1156 | wpid = waitpid (-1, &status, WNOHANG); | ||
1155 | } | 1157 | } |
1156 | } | 1158 | } |
1157 | } | 1159 | } |