diff options
-rw-r--r-- | scan.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -229,15 +229,11 @@ reap_all() sleep(1); } - if (r != -1) - continue; - - if (errno == EINTR) { - continue; - } else if (errno == ECHILD) { - break; - } else { - perror("wait()"); + if (r == -1) { + if (errno == EINTR) + continue; + if (errno != ECHILD) + perror("waitpid()"); break; } } @@ -256,10 +252,9 @@ try_wait() if (p == -1) { if (errno == EINTR) /* Impossible? */ continue; - else if (errno == ECHILD) /* In case there are no children */ - break; - else - err(1, "waitpid()"); + if (errno != ECHILD) + perror("waitpid()"); + break; } r = 1; |