From 044167be217dd75e671221f6f2e12f3f922a0ae4 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 24 Jun 2001 21:49:12 +0000 Subject: Signal cleanup. svn path=/trunk/; revision=3375 --- fetchmail.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 7b3ca71c..233a36d1 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -493,13 +493,16 @@ int main(int argc, char **argv) if (run.poll_interval && !getuid()) signal(SIGHUP, SIG_IGN); } - else if (run.logfile && access(run.logfile, F_OK) == 0) + else { - freopen(run.logfile, "a", stdout); - freopen(run.logfile, "a", stderr); + 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); + freopen(run.logfile, "a", stderr); + } } - #ifdef linux interface_init(); #endif /* linux */ -- cgit v1.2.3