From cd63d5822e76a6126bb3017567c9ce2869a44e0b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 29 Jun 2008 13:47:39 +0100 Subject: Now using an environment variable instead of a flag to pass state info when restarting the ForkDaemon. Preparing for a proper fallback when execv() fails. (Bug #425) --- ipc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ipc.c') diff --git a/ipc.c b/ipc.c index 9121026a..5232832e 100644 --- a/ipc.c +++ b/ipc.c @@ -32,7 +32,6 @@ #endif GSList *child_list = NULL; -static char *statefile = NULL; static void ipc_master_cmd_client( irc_t *data, char **cmd ) { @@ -500,11 +499,6 @@ char *ipc_master_save_state() } } -void ipc_master_set_statefile( char *fn ) -{ - statefile = g_strdup( fn ); -} - static gboolean new_ipc_client( gpointer data, gint serversock, b_input_condition cond ) { @@ -565,7 +559,7 @@ int ipc_master_listen_socket() /* FIXME: Open named pipe \\.\BITLBEE */ #endif -int ipc_master_load_state() +int ipc_master_load_state( char *statefile ) { struct bitlbee_child *child; FILE *fp; @@ -573,6 +567,7 @@ int ipc_master_load_state() if( statefile == NULL ) return 0; + fp = fopen( statefile, "r" ); unlink( statefile ); /* Why do it later? :-) */ if( fp == NULL ) -- cgit v1.2.3