aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-06-24 21:49:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-06-24 21:49:12 +0000
commit044167be217dd75e671221f6f2e12f3f922a0ae4 (patch)
tree4d3ce8151616640ebcdd71abd307aa8579cf3667
parent5d58bb226add86807ea2258d970f7c2c7334fbf2 (diff)
downloadfetchmail-044167be217dd75e671221f6f2e12f3f922a0ae4.tar.gz
fetchmail-044167be217dd75e671221f6f2e12f3f922a0ae4.tar.bz2
fetchmail-044167be217dd75e671221f6f2e12f3f922a0ae4.zip
Signal cleanup.
svn path=/trunk/; revision=3375
-rw-r--r--fetchmail.c11
1 files changed, 7 insertions, 4 deletions
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 */