Changeset bb34771
- Timestamp:
- 2010-03-14T16:35:55Z (15 years ago)
- Branches:
- master
- Children:
- caceb06
- Parents:
- 286b28e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
r286b28e rbb34771 109 109 chdir( "/" ); 110 110 111 /* Sometimes std* are already closed (for example when we're in a RESTARTed 112 BitlBee process. So let's only close TTY-fds. */ 113 if( isatty( 0 ) ) close( 0 ); 114 if( isatty( 1 ) ) close( 1 ); 115 if( isatty( 2 ) ) close( 2 ); 111 i = close( 0 ) == 0; 112 i += close( 1 ) == 0; 113 i += close( 2 ) == 0; 114 /* To avoid that something important ends up on one of those 115 fd's, open them for something bogus. Otherwise RESTART 116 may cause troubles. */ 117 while( i > 0 ) 118 { 119 open( "/dev/null", O_WRONLY ); 120 i --; 121 } 116 122 } 117 123 #endif
Note: See TracChangeset
for help on using the changeset viewer.