aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-04-01 07:50:04 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-04-01 07:50:04 +0000
commit71bc7ce6858ee50574dc574a948ea24b5d2d0bfc (patch)
tree99f8d8677fdb18690839fa5d8023aae4016c90b6 /daemon.c
parent26a916d0536f4048e3379bc7fe663ceb0944ce34 (diff)
downloadfetchmail-71bc7ce6858ee50574dc574a948ea24b5d2d0bfc.tar.gz
fetchmail-71bc7ce6858ee50574dc574a948ea24b5d2d0bfc.tar.bz2
fetchmail-71bc7ce6858ee50574dc574a948ea24b5d2d0bfc.zip
Debian 5.9.10 fixes.
svn path=/trunk/; revision=3603
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index 331ca767..d2a5b2d9 100644
--- a/daemon.c
+++ b/daemon.c
@@ -234,12 +234,19 @@ nottyDetach:
}
if (logfile)
- fd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0666); /* stdout */
+ {
+ if ((fd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0666)) < 0) { /* stdout */
+ report(stderr, "open %s (%s)\n", logfile, strerror(errno));
+ return(PS_IOERR);
+ }
+ }
else
+ {
if (dup(fd) < 0) { /* stdout */
report(stderr, "dup (%s)\n", strerror(errno));
return(PS_IOERR);
}
+ }
if (dup(fd) < 0) { /* stderr */
report(stderr, "dup (%s)\n", strerror(errno));
return(PS_IOERR);