X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=daemon.c;h=5ae73ed69565c6bd0d299b85e503494d0d448100;hb=f3efb867a6c3b539e8ab946584f3ed00e5f31a43;hp=cd60725fb840aefef2209ff01bc6bfdd23a90b36;hpb=1f340e9b7f0f585e7e6c48bf6605a7e7e6d756b3;p=~andy%2Ffetchmail diff --git a/daemon.c b/daemon.c index cd60725f..5ae73ed6 100644 --- a/daemon.c +++ b/daemon.c @@ -57,13 +57,13 @@ static RETSIGTYPE sigchld_handler (int sig) /* process SIGCHLD to obtain the exit code of the terminating process */ { - pid_t pid; #if defined(HAVE_WAITPID) /* the POSIX way */ int status; - while ((pid = waitpid(-1, &status, WNOHANG)) > 0) + while (waitpid(-1, &status, WNOHANG) > 0) continue; /* swallow 'em up. */ #elif defined(HAVE_WAIT3) /* the BSD way */ + pid_t pid; #if defined(HAVE_UNION_WAIT) && !defined(__FreeBSD__) union wait status; #else @@ -208,7 +208,7 @@ nottyDetach: (void)close(0); /* Reopen stdin descriptor on /dev/null */ - if ((fd = open("/dev/null", O_RDWR)) < 0) { /* stdin */ + if (open("/dev/null", O_RDWR) < 0) { /* stdin */ report(stderr, "cannot open /dev/null: %s\n", strerror(errno)); return(PS_IOERR); }