From 0135a7c415665a09eefe0cd6545d322bff0aa361 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 26 Sep 2001 13:55:29 +0000 Subject: Avoid zombie proliferation. svn path=/trunk/; revision=3487 --- fetchmail.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index e412e33d..2e8cd94f 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -463,14 +463,15 @@ int main(int argc, char **argv) SOCKSinit("fetchmail"); #endif /* HAVE_SOCKS */ + /* avoid zombies from plugins */ + deal_with_sigchld(); + /* * Maybe time to go to demon mode... */ if (run.poll_interval) { - if (nodetach) - deal_with_sigchld(); - else + if (!nodetach) daemonize(run.logfile, terminate_run); report(stdout, GT_("starting fetchmail %s daemon \n"), VERSION); @@ -484,7 +485,6 @@ int main(int argc, char **argv) } else { - deal_with_sigchld(); /* or else we may accumulate too many zombies */ if (run.logfile && access(run.logfile, F_OK) == 0) { freopen(run.logfile, "a", stdout); -- cgit v1.2.3