diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-20 18:03:18 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-20 18:03:18 +0000 | 
| commit | 81ee561d520e38535fb6947ac0e3fba808e6de4b (patch) | |
| tree | 122a46d40947e854fa643938c89ae7a6889eb52a /bitlbee.c | |
| parent | 33304688895db5751f9ef087ff92b0a9dc284627 (diff) | |
| parent | 0baed0da940c0d82280a5674d7fa8ad06d449384 (diff) | |
Merging head. Most changes are not so relevant because they're to IM
modules.
Diffstat (limited to 'bitlbee.c')
| -rw-r--r-- | bitlbee.c | 18 | 
1 files changed, 7 insertions, 11 deletions
| @@ -108,17 +108,13 @@ int bitlbee_daemon_init()  		chdir( "/" ); -		i = close( 0 ) == 0; -		i += close( 1 ) == 0; -		i += close( 2 ) == 0; -		/* To avoid that something important ends up on one of those -		   fd's, open them for something bogus. Otherwise RESTART -		   may cause troubles. */ -		while( i > 0 ) -		{ -			open( "/dev/null", O_WRONLY ); -			i --; -		} +		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 | 
