From 0ecee636d725efa7cec1b2fa3f0a9e271885858e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 19 Feb 2010 05:25:58 +0000 Subject: [PATCH] (trunk daemon) print a warning to stderr when tr_daemon() can't open /dev/null --- daemon/daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/daemon.c b/daemon/daemon.c index 88434902d..de74dfe98 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -172,6 +172,8 @@ tr_daemon( int nochdir, int noclose ) /* send stdin, stdout, and stderr to /dev/null */ int i; int fd = open( "/dev/null", O_RDWR, 0 ); + if( fd < 0 ) + fprintf( stderr, "unable to open /dev/null: %s\n", tr_strerror(errno) ); for( i=0; i<3; ++i ) { if( close( i ) ) return -1;