Skip to content

Commit

Permalink
Merge pull request #3449 from dilyanpalauzov/janitor_goes_crazy
Browse files Browse the repository at this point in the history
master:reap_child() survive SIGINT
  • Loading branch information
ksmurchison authored Sep 11, 2024
2 parents 832e0c8 + 6acbd60 commit 226f929
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion master/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,14 @@ static void reap_child(void)
struct service *wd;
int failed;

while ((pid = waitpid((pid_t) -1, &status, WNOHANG)) > 0) {
while ((pid = waitpid((pid_t) -1, &status, WNOHANG)) > -1) {
if (pid == 0) {
if (errno == EINTR) {
errno = 0;
continue;
}
break;
}

/* account for the child */
c = centry_find(pid);
Expand Down

0 comments on commit 226f929

Please sign in to comment.