Hello, while browsing the source code of init, I found a couple of calls to waitpid which, I believe, could be replaced with wait(NULL). As far as I can tell lib/libc/gen/wait.c and lib/libc/gen/waitpid.c backup my belief but on the other hand I am very new to this stuff so I may be wrong so sorry if this is a waste of your time. The FAQ says that I should send the patch inline but the mailing lists page says that I can send it as an attachment so I did both. Thanks for checking out my commit! Here is the patch:
diff --git a/sbin/init/init.c b/sbin/init/init.c index cf7ed60afe9..1456f9508f7 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1176,7 +1176,7 @@ f_multi_user(void) } while (!requested_transition) - if ((pid = waitpid(-1, NULL, 0)) != -1) + if ((pid = wait(NULL)) != -1) collect_child(pid); return requested_transition; @@ -1360,7 +1360,7 @@ f_nice_death(void) clang = 0; alarm(DEATH_WATCH); do { - if ((pid = waitpid(-1, NULL, 0)) != -1) + if ((pid = wait(NULL)) != -1) collect_child(pid); } while (clang == 0 && errno != ECHILD); @@ -1404,7 +1404,7 @@ f_death(void) clang = 0; alarm(DEATH_WATCH); do { - if ((pid = waitpid(-1, NULL, 0)) != -1) + if ((pid = wait(NULL)) != -1) collect_child(pid); } while (clang == 0 && errno != ECHILD);
wait_pid_to_wait.diff
Description: Binary data