aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-08-25 18:52:53 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-08-25 18:52:53 +0200
commite0e7a74bde52a1aa02d1da758128722598fb6dd8 (patch)
tree3064dd064dcde0969467c6d2e068d8ccbbd648b1 /daemon.c
parent5256f6122e9843b1e9988a742ed6c2a4923bc2bd (diff)
downloadfetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.tar.gz
fetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.tar.bz2
fetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.zip
Align with legacy_6x.
* Normalize include order. * Backport missed bug fixes. * Remove dead code.
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/daemon.c b/daemon.c
index 58dee539..53bc4dcb 100644
--- a/daemon.c
+++ b/daemon.c
@@ -238,12 +238,15 @@ nottyDetach:
if (dup(logfd) < 0 /* stdout */
|| ((logfd == 0 || logfd >= 3) && dup(logfd) < 0)) { /* stderr */
- report(stderr, "dup (%s)\n", strerror(errno));
+ report(stderr, "dup(): %s\n", strerror(errno));
return(PS_IOERR);
}
/* move to root directory, so we don't prevent filesystem unmounts */
- chdir("/");
+ if (chdir("/")) {
+ report(stderr, "chdir(\"/\"): %s\n", strerror(errno));
+ return PS_IOERR;
+ }
/* set our umask to something reasonable (we hope) */
#if defined(DEF_UMASK)