Changes in unix.c [cd63d58:51bbec0]
Legend:
- Unmodified
- Added
- Removed
-
unix.c
rcd63d58 r51bbec0 40 40 static void sighandler( int signal ); 41 41 42 int main( int argc, char *argv[] )42 int main( int argc, char *argv[], char **envp ) 43 43 { 44 44 int i = 0; … … 135 135 { 136 136 char *fn = ipc_master_save_state(); 137 char **args; 138 int n, i; 137 139 138 140 chdir( old_cwd ); 139 141 140 setenv( "_BITLBEE_RESTART_STATE", fn, 1 ); 141 g_free( fn ); 142 n = 0; 143 args = g_new0( char *, argc + 3 ); 144 args[n++] = argv[0]; 145 if( fn ) 146 { 147 args[n++] = "-R"; 148 args[n++] = fn; 149 } 150 for( i = 1; argv[i] && i < argc; i ++ ) 151 { 152 if( strcmp( argv[i], "-R" ) == 0 ) 153 i += 2; 154 155 args[n++] = argv[i]; 156 } 142 157 143 158 close( global.listen_socket ); 144 159 145 if( execv( argv[0], argv ) == -1 ) 146 /* Apparently the execve() failed, so let's just 147 jump back into our own/current main(). */ 148 /* Need more cleanup code to make this work. */ 149 return 1; /* main( argc, argv ); */ 160 execve( args[0], args, envp ); 150 161 } 151 162
Note: See TracChangeset
for help on using the changeset viewer.