]> granicus.if.org Git - transmission/commitdiff
(trunk daemon) print a warning to stderr when tr_daemon() can't open /dev/null
authorCharles Kerr <charles@transmissionbt.com>
Fri, 19 Feb 2010 05:25:58 +0000 (05:25 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 19 Feb 2010 05:25:58 +0000 (05:25 +0000)
daemon/daemon.c

index 88434902d1264428068162124c84f10e598ad6a2..de74dfe989a38915d2e10dd876962c1ef9995a77 100644 (file)
@@ -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;