(trunk daemon) print a warning to stderr when tr_daemon() can't open /dev/null
This commit is contained in:
parent
fea912dd21
commit
0ecee636d7
|
@ -172,6 +172,8 @@ tr_daemon( int nochdir, int noclose )
|
||||||
/* send stdin, stdout, and stderr to /dev/null */
|
/* send stdin, stdout, and stderr to /dev/null */
|
||||||
int i;
|
int i;
|
||||||
int fd = open( "/dev/null", O_RDWR, 0 );
|
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 ) {
|
for( i=0; i<3; ++i ) {
|
||||||
if( close( i ) )
|
if( close( i ) )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue