aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scan.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/scan.c b/scan.c
index b18ad60..8e92a68 100644
--- a/scan.c
+++ b/scan.c
@@ -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;