diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-02-03 02:55:59 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-02-03 02:55:59 +0000 |
commit | d0c2c187633fa906eee672c21f46a2ac68148d15 (patch) | |
tree | fc51a3d3a52c16d7edc82f1a388f4107ea238d95 /daemon.c | |
parent | b7406a23e1b4e9279e7bffd88352a20574a45f62 (diff) | |
download | fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.tar.gz fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.tar.bz2 fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.zip |
Simplify error reporting further.
svn path=/trunk/; revision=2374
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -109,7 +109,7 @@ daemonize (const char *logfile, void (*termhook)(int)) group leader */ if ((childpid = fork()) < 0) { - report(stderr, errno, "fork\n"); + report(stderr, "fork (%s)\n", strerror(errno)); return(PS_IOERR); } else if (childpid > 0) @@ -122,7 +122,7 @@ daemonize (const char *logfile, void (*termhook)(int)) #if defined(HAVE_SETSID) /* POSIX */ /* POSIX makes this soooo easy to do */ if (setsid() < 0) { - report(stderr, errno, "setsid\n"); + report(stderr, "setsid (%s)\n", strerror(errno)); return(PS_IOERR); } #elif defined(SIGTSTP) /* BSD */ @@ -144,7 +144,7 @@ daemonize (const char *logfile, void (*termhook)(int)) /* lose controlling tty */ signal(SIGHUP, SIG_IGN); if ((childpid = fork()) < 0) { - report(stderr, errno, "fork\n"); + report(stderr, "fork (%)\n", strerror(errno)); return(PS_IOERR); } else if (childpid > 0) { @@ -168,7 +168,7 @@ nottyDetach: /* Reopen stdin descriptor on /dev/null */ if ((fd = open("/dev/null", O_RDWR)) < 0) { /* stdin */ - report(stderr, errno, "open: /dev/null\n"); + report(stderr, "open: /dev/null (%s)\n", strerror(errno)); return(PS_IOERR); } @@ -176,11 +176,11 @@ nottyDetach: fd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0666); /* stdout */ else if (dup(fd) < 0) { /* stdout */ - report(stderr, errno, "dup\n"); + report(stderr, "dup (%s)\n", strerror(errno)); return(PS_IOERR); } if (dup(fd) < 0) { /* stderr */ - report(stderr, errno, "dup\n"); + report(stderr, "dup (%s)\n", strerror(errno)); return(PS_IOERR); } |