diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2019-08-25 18:52:53 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2019-08-25 18:52:53 +0200 |
commit | e0e7a74bde52a1aa02d1da758128722598fb6dd8 (patch) | |
tree | 3064dd064dcde0969467c6d2e068d8ccbbd648b1 /daemon.c | |
parent | 5256f6122e9843b1e9988a742ed6c2a4923bc2bd (diff) | |
download | fetchmail-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |