diff options
author | Marius Halden <marius.h@lden.org> | 2015-11-28 00:48:24 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2015-11-28 00:48:24 +0100 |
commit | a999c7b5e79ca3fba37e32182bac8236bd7d0f4a (patch) | |
tree | 36a3cb73419c9ec98a9cb33c332513351f202468 | |
parent | 2dc7e9e6bd7f70fde6ea09bbb5372a11f90f698a (diff) | |
download | svcmon-a999c7b5e79ca3fba37e32182bac8236bd7d0f4a.tar.gz svcmon-a999c7b5e79ca3fba37e32182bac8236bd7d0f4a.tar.bz2 svcmon-a999c7b5e79ca3fba37e32182bac8236bd7d0f4a.tar.xz |
Clean up some error handling
-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; |