diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-30 00:41:39 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-30 00:41:39 +0100 | 
| commit | f5d1b3185140e690a6503b9e68c7ea28655b405e (patch) | |
| tree | f679a139ecca219aa2c7a07adcaefd3000c8c801 /bitlbee.c | |
| parent | cd63d5822e76a6126bb3017567c9ce2869a44e0b (diff) | |
| parent | 913545e54123296fb8229ecad2c77a6e899e0242 (diff) | |
Merging changes from Jelmer: It's now possible to cross-compile a Windows
version of BitlBee from Linux. No working SSL support yet though!
Diffstat (limited to 'bitlbee.c')
| -rw-r--r-- | bitlbee.c | 9 | 
1 files changed, 5 insertions, 4 deletions
| @@ -122,6 +122,7 @@ int bitlbee_daemon_init()  	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 ); | 
