Changes in unix.c [51bbec0:cd63d58]
Legend:
- Unmodified
- Added
- Removed
-
unix.c
r51bbec0 rcd63d58 40 40 static void sighandler( int signal ); 41 41 42 int main( int argc, char *argv[] , char **envp)42 int main( int argc, char *argv[] ) 43 43 { 44 44 int i = 0; … … 135 135 { 136 136 char *fn = ipc_master_save_state(); 137 char **args;138 int n, i;139 137 140 138 chdir( old_cwd ); 141 139 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 } 140 setenv( "_BITLBEE_RESTART_STATE", fn, 1 ); 141 g_free( fn ); 157 142 158 143 close( global.listen_socket ); 159 144 160 execve( args[0], args, envp ); 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 ); */ 161 150 } 162 151
Note: See TracChangeset
for help on using the changeset viewer.