From 71bc7ce6858ee50574dc574a948ea24b5d2d0bfc Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 1 Apr 2002 07:50:04 +0000 Subject: Debian 5.9.10 fixes. svn path=/trunk/; revision=3603 --- daemon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'daemon.c') 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); -- cgit v1.2.3