diff options
| author | Sven Moritz Hallberg <pesco@khjk.org> | 2010-06-03 12:41:03 +0200 | 
|---|---|---|
| committer | Sven Moritz Hallberg <pesco@khjk.org> | 2010-06-03 12:41:03 +0200 | 
| commit | 5f8ab6a9adf09ea7c07f728227bdb6d3953588f1 (patch) | |
| tree | 1b708f624d5ee996217055aec11490f06024efca /bitlbee.c | |
| parent | 3f81999c20852f14a5fb27a6ef6c5ea44db61a4d (diff) | |
| parent | f9928cb319c2879a56b7280f09723b26035982d0 (diff) | |
merge in bitlbee 1.2.5
Diffstat (limited to 'bitlbee.c')
| -rw-r--r-- | bitlbee.c | 12 | 
1 files changed, 7 insertions, 5 deletions
| @@ -108,11 +108,13 @@ int bitlbee_daemon_init()  		chdir( "/" ); -		/* Sometimes std* are already closed (for example when we're in a RESTARTed -		   BitlBee process. So let's only close TTY-fds. */ -		if( isatty( 0 ) ) close( 0 ); -		if( isatty( 1 ) ) close( 1 ); -		if( isatty( 2 ) ) close( 2 ); +		if( getenv( "_BITLBEE_RESTART_STATE" ) == NULL ) +			for( i = 0; i < 3; i ++ ) +				if( close( i ) == 0 ) +				{ +					/* Keep something bogus on those fd's just in case. */ +					open( "/dev/null", O_WRONLY ); +				}  	}  #endif | 
