From c08dbcb02b7f295f2990767ca1ac9eea9e91f9e2 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 22 Sep 2004 17:51:05 +0000 Subject: Cleanup zombie processes as early as possible --- src/clamsmtpd.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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) + ; + } } /* ---------------------------------------------------------------------------------- -- cgit v1.2.3