diff options
Diffstat (limited to 'bitlbee.c')
| -rw-r--r-- | bitlbee.c | 11 | 
1 files changed, 6 insertions, 5 deletions
| @@ -117,11 +117,12 @@ int bitlbee_daemon_init()  #endif  	if( global.conf->runmode == RUNMODE_FORKDAEMON ) -		ipc_master_load_state(); +		ipc_master_load_state( getenv( "_BITLBEE_RESTART_STATE" ) );  	if( global.conf->runmode == RUNMODE_DAEMON || global.conf->runmode == RUNMODE_FORKDAEMON )  		ipc_master_listen_socket(); +#ifndef _WIN32  	if( ( fp = fopen( global.conf->pidfile, "w" ) ) )  	{  		fprintf( fp, "%d\n", (int) getpid() ); @@ -131,6 +132,7 @@ int bitlbee_daemon_init()  	{  		log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile );  	} +#endif  	return( 0 );  } @@ -140,9 +142,6 @@ int bitlbee_inetd_init()  	if( !irc_new( 0 ) )  		return( 1 ); -	log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); -	log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); -	  	return( 0 );  } @@ -253,7 +252,6 @@ static gboolean bitlbee_io_new_client( gpointer data, gint fd, b_input_condition  	socklen_t size = sizeof( struct sockaddr_in );  	struct sockaddr_in conn_info;  	int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size ); -	pid_t client_pid = 0;  	if( new_socket == -1 )  	{ @@ -261,8 +259,10 @@ static gboolean bitlbee_io_new_client( gpointer data, gint fd, b_input_condition  		return TRUE;  	} +#ifndef _WIN32  	if( global.conf->runmode == RUNMODE_FORKDAEMON )  	{ +		pid_t client_pid = 0;  		int fds[2];  		if( socketpair( AF_UNIX, SOCK_STREAM, 0, fds ) == -1 ) @@ -319,6 +319,7 @@ static gboolean bitlbee_io_new_client( gpointer data, gint fd, b_input_condition  		}  	}  	else +#endif  	{  		log_message( LOGLVL_INFO, "Creating new connection with fd %d.", new_socket );  		irc_new( new_socket ); | 
