diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 13:56:52 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 13:56:52 +0000 | 
| commit | 75554d0a484d21f95fcf24394f89c541a650acaf (patch) | |
| tree | 51d9dc322baeb2e542fc13d9ba69e74f70a87636 /bitlbee.c | |
| parent | e5e795dae28c7871a47040436454a456fb338820 (diff) | |
| parent | f9928cb319c2879a56b7280f09723b26035982d0 (diff) | |
Merging in 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 | 
