diff options
author | Sunil Nimmagadda <sunil@poolp.org> | 2014-04-10 18:12:38 +0500 |
---|---|---|
committer | Sunil Nimmagadda <sunil@poolp.org> | 2014-04-10 18:12:38 +0500 |
commit | f5348e8562c4ac452a8aa93b3b16c2c76133f580 (patch) | |
tree | a38cf332eb9ca7b9c8066cfa4bd7b6fcc3cbc465 | |
parent | 178fb764cf7835f3e0090b1a970742678333f8af (diff) | |
parent | 90be9f6501860a22f694ef1659bef4d9182154e8 (diff) |
Merge pull request #3 from jturner/killzombies
Make sure zombie processes are not left over
-rw-r--r-- | pop3d.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -203,8 +203,9 @@ sig_handler(int sig, short event, void *arg) event_loopexit(NULL); break; case SIGCHLD: - if (waitpid(pop3e_pid, &status, WNOHANG) > 0) - if (WIFEXITED(status) || WIFSIGNALED(status)) { + if (waitpid(WAIT_ANY, &status, WNOHANG) > 0) + if ((WIFEXITED(status) && WEXITSTATUS(status) != 0) || + WIFSIGNALED(status)) { logit(LOG_ERR, "Lost pop3 engine"); event_loopexit(NULL); } |