summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-09-22 17:51:05 +0000
committerStef Walter <stef@memberwebs.com>2004-09-22 17:51:05 +0000
commitc08dbcb02b7f295f2990767ca1ac9eea9e91f9e2 (patch)
tree1cf283cea48c354915b8bf02716b482c3a5ba355
parent4c8ff241430029241e0d530453b970c1f7092356 (diff)
Cleanup zombie processes as early as possible
-rw-r--r--src/clamsmtpd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c
index 44ccf46..253d1ee 100644
--- a/src/clamsmtpd.c
+++ b/src/clamsmtpd.c
@@ -458,10 +458,18 @@ spctx_t* cb_new_context()
void cb_del_context(spctx_t* sp)
{
clctx_t* ctx = (clctx_t*)sp;
+ int x;
ASSERT(sp);
disconnect_clam(ctx);
free(ctx);
+
+ if(g_clstate.virusaction)
+ {
+ /* Cleanup any old actions */
+ while(waitpid(-1, &x, WNOHANG) > 0)
+ ;
+ }
}
/* ----------------------------------------------------------------------------------