From 90be9f6501860a22f694ef1659bef4d9182154e8 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 9 Apr 2014 21:36:45 -0400 Subject: Make sure zombie processes are left over --- pop3d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pop3d.c b/pop3d.c index 77cbfa0..73656a8 100644 --- a/pop3d.c +++ b/pop3d.c @@ -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); } -- cgit v1.2.3