aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/init.c')
-rw-r--r--toys/pending/init.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/toys/pending/init.c b/toys/pending/init.c
index b147911f..afc9a3ed 100644
--- a/toys/pending/init.c
+++ b/toys/pending/init.c
@@ -308,11 +308,7 @@ static void waitforpid(pid_t pid)
{
if (pid <= 0) return;
- for(;;) {
- pid_t y = wait(NULL);
- mark_as_terminated_process(y);
- if (kill(y, 0)) break;
- }
+ while (!kill(pid, 0)) mark_as_terminated_process(wait(NULL));
}
static void run_action_from_list(int action)