From bd9b00f4fed3560eab98f15cf9923aed13467d5d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 19 Jan 2006 18:07:47 +0100 Subject: Fixes for single-process daemon mode, changed value of USTATUS_SHUTDOWN. If this still causes problems, shutting down should be an extra flag instead of a status code. --- ipc.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'ipc.c') diff --git a/ipc.c b/ipc.c index 5fda047c..4777113a 100644 --- a/ipc.c +++ b/ipc.c @@ -35,12 +35,15 @@ static int ipc_master_cmd_client( irc_t *data, char **cmd ) { struct bitlbee_child *child = (void*) data; - child->host = g_strdup( cmd[1] ); - child->nick = g_strdup( cmd[2] ); - child->realname = g_strdup( cmd[3] ); + if( child ) + { + child->host = g_strdup( cmd[1] ); + child->nick = g_strdup( cmd[2] ); + child->realname = g_strdup( cmd[3] ); + } ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n", - child->pid, child->nick, child->host, child->realname ); + child ? child->pid : -1, cmd[2], cmd[1], cmd[3] ); return 1; } @@ -307,7 +310,10 @@ void ipc_to_master_str( char *format, ... ) } else if( global.conf->runmode == RUNMODE_DAEMON ) { - char **cmd; + char **cmd, *s; + + if( ( s = strchr( msg_buf, '\r' ) ) ) + *s = 0; cmd = irc_parse_line( msg_buf ); ipc_command_exec( NULL, cmd, ipc_master_commands ); @@ -360,7 +366,10 @@ void ipc_to_children_str( char *format, ... ) } else if( global.conf->runmode == RUNMODE_DAEMON ) { - char **cmd; + char **cmd, *s; + + if( ( s = strchr( msg_buf, '\r' ) ) ) + *s = 0; cmd = irc_parse_line( msg_buf ); ipc_to_children( cmd ); -- cgit v1.2.3