diff --git a/master/master.c b/master/master.c index 8425ef1db7..ca7cd6589e 100644 --- a/master/master.c +++ b/master/master.c @@ -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);