Index: bitlbee.c
===================================================================
--- bitlbee.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ bitlbee.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -45,5 +45,4 @@
 	int i;
 	GIOChannel *ch;
-	FILE *fp;
 	
 	log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG );
@@ -105,27 +104,10 @@
 		else if( i != 0 ) 
 			exit( 0 );
-		
+		close( 0 );
+		close( 1 );
+		close( 2 );
 		chdir( "/" );
-		
-		/* Sometimes std* are already closed (for example when we're in a RESTARTed
-		   BitlBee process. So let's only close TTY-fds. */
-		if( isatty( 0 ) ) close( 0 );
-		if( isatty( 0 ) ) close( 1 );
-		if( isatty( 0 ) ) close( 2 );
 	}
 #endif
-	
-	if( global.conf->runmode == RUNMODE_FORKDAEMON )
-		ipc_master_load_state();
-	
-	if( ( fp = fopen( global.conf->pidfile, "w" ) ) )
-	{
-		fprintf( fp, "%d\n", (int) getpid() );
-		fclose( fp );
-	}
-	else
-	{
-		log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile );
-	}
 	
 	return( 0 );
@@ -253,10 +235,4 @@
 	int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size );
 	pid_t client_pid = 0;
-	
-	if( new_socket == -1 )
-	{
-		log_message( LOGLVL_WARNING, "Could not accept new connection: %s", strerror( errno ) );
-		return TRUE;
-	}
 	
 	if( global.conf->runmode == RUNMODE_FORKDAEMON )
Index: bitlbee.h
===================================================================
--- bitlbee.h	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ bitlbee.h	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -121,5 +121,4 @@
 	char *helpfile;
 	GMainLoop *loop;
-	int restart;
 } global_t;
 
Index: conf.c
===================================================================
--- conf.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ conf.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -32,5 +32,4 @@
 #include "ini.h"
 #include "url.h"
-#include "ipc.h"
 
 #include "protocols/proxy.h"
@@ -62,5 +61,4 @@
 	conf->configdir = g_strdup( CONFIG );
 	conf->plugindir = g_strdup( PLUGINDIR );
-	conf->pidfile = g_strdup( "/var/run/bitlbee.pid" );
 	conf->motdfile = g_strdup( ETCDIR "/motd.txt" );
 	conf->ping_interval = 180;
@@ -79,5 +77,5 @@
 	}
 	
-	while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:" ) ) >= 0 )
+	while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 )
 	/*     ^^^^ Just to make sure we skip this step from the REHASH handler. */
 	{
@@ -94,9 +92,4 @@
 			}
 			conf->port = i;
-		}
-		else if( opt == 'p' )
-		{
-			g_free( conf->pidfile );
-			conf->pidfile = g_strdup( optarg );
 		}
 		else if( opt == 'n' )
@@ -149,12 +142,4 @@
 			return( NULL );
 		}
-		else if( opt == 'R' )
-		{
-			/* We can't load the statefile yet (and should make very sure we do this
-			   only once), so set the filename here and load the state information
-			   when initializing ForkDaemon. (This option only makes sense in that
-			   mode anyway!) */
-			ipc_master_set_statefile( optarg );
-		}
 	}
 	
@@ -190,9 +175,4 @@
 				else
 					conf->runmode = RUNMODE_INETD;
-			}
-			else if( g_strcasecmp( ini->key, "pidfile" ) == 0 )
-			{
-				g_free( conf->pidfile );
-				conf->pidfile = g_strdup( ini->value );
 			}
 			else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 )
Index: conf.h
===================================================================
--- conf.h	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ conf.h	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -43,5 +43,4 @@
 	char *configdir;
 	char *plugindir;
-	char *pidfile;
 	char *motdfile;
 	char *primary_storage;
Index: configure
===================================================================
--- configure	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ configure	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -14,5 +14,4 @@
 datadir='$prefix/share/bitlbee/'
 config='/var/lib/bitlbee/'
-pidfile='/var/run/bitlbee.pid'
 plugindir='$prefix/lib/bitlbee'
 
@@ -47,5 +46,4 @@
 --datadir=...						$datadir
 --plugindir=...						$plugindir
---pidfile=...						$pidfile
 --config=...						$config
 
@@ -76,5 +74,4 @@
 config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
 plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
-pidfile=`eval echo "$pidfile/" | sed 's/\/\{1,\}/\//g'`
 
 cat<<EOF>Makefile.settings
@@ -86,5 +83,4 @@
 DATADIR=$datadir
 PLUGINDIR=$plugindir
-PIDFILE=$pidfile
 CONFIG=$config
 
@@ -108,5 +104,4 @@
 #define VARDIR "$datadir"
 #define PLUGINDIR "$plugindir"
-#define PIDFILE "$pidfile"
 #define ARCH "$arch"
 #define CPU "$cpu"
Index: ipc.c
===================================================================
--- ipc.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ ipc.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -2,5 +2,5 @@
   * BitlBee -- An IRC to other IM-networks gateway                     *
   *                                                                    *
-  * Copyright 2002-2006 Wilmer van der Gaast and others                *
+  * Copyright 2002-2004 Wilmer van der Gaast and others                *
   \********************************************************************/
 
@@ -30,5 +30,5 @@
 
 GSList *child_list = NULL;
-static char *statefile = NULL;
+
 
 static void ipc_master_cmd_client( irc_t *data, char **cmd )
@@ -36,5 +36,5 @@
 	struct bitlbee_child *child = (void*) data;
 	
-	if( child && cmd[1] )
+	if( child )
 	{
 		child->host = g_strdup( cmd[1] );
@@ -43,7 +43,6 @@
 	}
 	
-	if( g_strcasecmp( cmd[0], "CLIENT" ) == 0 )
-		ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
-		                     child ? child->pid : -1, cmd[2], cmd[1], cmd[3] );
+	ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
+	                     child ? child->pid : -1, cmd[2], cmd[1], cmd[3] );
 }
 
@@ -75,21 +74,6 @@
 }
 
-void ipc_master_cmd_restart( irc_t *data, char **cmd )
-{
-	struct bitlbee_child *child = (void*) data;
-	
-	if( global.conf->runmode != RUNMODE_FORKDAEMON )
-	{
-		/* Tell child that this is unsupported. */
-		return;
-	}
-	
-	global.restart = -1;
-	bitlbee_shutdown( NULL );
-}
-
 static const command_t ipc_master_commands[] = {
 	{ "client",     3, ipc_master_cmd_client,     0 },
-	{ "hello",      0, ipc_master_cmd_client,     0 },
 	{ "die",        0, ipc_master_cmd_die,        0 },
 	{ "wallops",    1, NULL,                      IPC_CMD_TO_CHILDREN },
@@ -98,5 +82,4 @@
 	{ "rehash",     0, ipc_master_cmd_rehash,     0 },
 	{ "kill",       2, NULL,                      IPC_CMD_TO_CHILDREN },
-	{ "restart",    0, ipc_master_cmd_restart,    0 },
 	{ NULL }
 };
@@ -157,12 +140,4 @@
 	irc_write( irc, ":%s!%s@%s KILL %s :%s", irc->mynick, irc->mynick, irc->myhost, irc->nick, cmd[2] );
 	irc_abort( irc, 0, "Killed by operator: %s", cmd[2] );
-}
-
-static void ipc_child_cmd_hello( irc_t *irc, char **cmd )
-{
-	if( irc->status < USTATUS_LOGGED_IN )
-		ipc_to_master_str( "HELLO\r\n" );
-	else
-		ipc_to_master_str( "HELLO %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
 }
 
@@ -174,5 +149,4 @@
 	{ "rehash",     0, ipc_child_cmd_rehash,      0 },
 	{ "kill",       2, ipc_child_cmd_kill,        0 },
-	{ "hello",      0, ipc_child_cmd_hello,       0 },
 	{ NULL }
 };
@@ -411,90 +385,2 @@
 	child_list = NULL;
 }
-
-char *ipc_master_save_state()
-{
-	char *fn = g_strdup( "/tmp/bee-restart.XXXXXX" );
-	int fd = mkstemp( fn );
-	GSList *l;
-	FILE *fp;
-	int i;
-	
-	if( fd == -1 )
-	{
-		log_message( LOGLVL_ERROR, "Could not create temporary file: %s", strerror( errno ) );
-		g_free( fn );
-		return NULL;
-	}
-	
-	/* This is more convenient now. */
-	fp = fdopen( fd, "w" );
-	
-	for( l = child_list, i = 0; l; l = l->next )
-		i ++;
-	
-	/* Number of client processes. */
-	fprintf( fp, "%d\n", i );
-	
-	for( l = child_list; l; l = l->next )
-		fprintf( fp, "%d %d\n", ((struct bitlbee_child*)l->data)->pid,
-		                        ((struct bitlbee_child*)l->data)->ipc_fd );
-	
-	if( fclose( fp ) == 0 )
-	{
-		return fn;
-	}
-	else
-	{
-		unlink( fn );
-		g_free( fn );
-		return NULL;
-	}
-}
-
-void ipc_master_set_statefile( char *fn )
-{
-	statefile = g_strdup( fn );
-}
-
-int ipc_master_load_state()
-{
-	struct bitlbee_child *child;
-	FILE *fp;
-	int i, n;
-	
-	if( statefile == NULL )
-		return 0;
-	fp = fopen( statefile, "r" );
-	unlink( statefile );	/* Why do it later? :-) */
-	if( fp == NULL )
-		return 0;
-	
-	if( fscanf( fp, "%d", &n ) != 1 )
-	{
-		log_message( LOGLVL_WARNING, "Could not import state information for child processes." );
-		fclose( fp );
-		return 0;
-	}
-	
-	log_message( LOGLVL_INFO, "Importing information for %d child processes.", n );
-	for( i = 0; i < n; i ++ )
-	{
-		child = g_new0( struct bitlbee_child, 1 );
-		
-		if( fscanf( fp, "%d %d", &child->pid, &child->ipc_fd ) != 2 )
-		{
-			log_message( LOGLVL_WARNING, "Unexpected end of file: Only processed %d clients.", i );
-			g_free( child );
-			fclose( fp );
-			return 0;
-		}
-		child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
-		
-		child_list = g_slist_append( child_list, child );
-	}
-	
-	ipc_to_children_str( "HELLO\r\n" );
-	ipc_to_children_str( "OPERMSG :New BitlBee master process started (version " BITLBEE_VERSION ")\r\n" );
-	
-	return 1;
-}
Index: ipc.h
===================================================================
--- ipc.h	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ ipc.h	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -54,8 +54,4 @@
 void ipc_master_cmd_rehash( irc_t *data, char **cmd );
 
-char *ipc_master_save_state();
-void ipc_master_set_statefile( char *fn );
-int ipc_master_load_state();
-
 
 extern GSList *child_list;
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ irc_commands.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -573,5 +573,4 @@
 	{ "lilo",        1, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
 	{ "rehash",      0, irc_cmd_rehash,      IRC_CMD_OPER_ONLY },
-	{ "restart",     0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
 	{ "kill",        2, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
 	{ NULL }
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ protocols/msn/msn.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -84,6 +84,4 @@
 		{
 			m = l->data;
-		
-			serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
 			g_free( m->who );
 			g_free( m->text );
@@ -91,4 +89,6 @@
 		}
 		g_slist_free( md->msgq );
+		
+		serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message(s), you'll have to resend them." );
 	}
 	
Index: protocols/msn/sb.c
===================================================================
--- protocols/msn/sb.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ protocols/msn/sb.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -213,5 +213,4 @@
 		{
 			m = l->data;
-
 			g_free( m->who );
 			g_free( m->text );
@@ -220,7 +219,5 @@
 		g_slist_free( sb->msgq );
 		
-		serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with "
-		                   "unsent message to %s, you'll have to resend it.",
-		                   m->who ? m->who : "(unknown)" );
+		serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with unsent message(s), you'll have to resend them." );
 	}
 	
Index: root_commands.c
===================================================================
--- root_commands.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ root_commands.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -601,7 +601,4 @@
 	{
 		set_setstr( irc, cmd[1], cmd[2] );
-		
-		if( ( strcmp( cmd[2], "=" ) ) == 0 && cmd[3] )
-			irc_usermsg( irc, "Warning: Correct syntax: \002set <variable> <value>\002 (without =)" );
 	}
 	if( cmd[1] ) /* else 'forgotten' on purpose.. Must show new value after changing */
Index: unix.c
===================================================================
--- unix.c	(revision ec3e4116687f5e990e6d24e2c79e629665ac5e7e)
+++ unix.c	(revision 9fae35c9cf2d5a319623946705e5d7179ea5c338)
@@ -29,5 +29,4 @@
 #include "protocols/nogaim.h"
 #include "help.h"
-#include "ipc.h"
 #include <signal.h>
 #include <unistd.h>
@@ -39,8 +38,7 @@
 static void sighandler( int signal );
 
-int main( int argc, char *argv[], char **envp )
+int main( int argc, char *argv[] )
 {
 	int i = 0;
-	char *old_cwd;
 	struct sigaction sig, old;
 	
@@ -75,13 +73,4 @@
 	else if( global.conf->runmode == RUNMODE_FORKDAEMON )
 	{
-		/* In case the operator requests a restart, we need this. */
-		old_cwd = g_malloc( 256 );
-		if( getcwd( old_cwd, 255 ) == NULL )
-		{
-			log_message( LOGLVL_WARNING, "Could not save current directory: %s", strerror( errno ) );
-			g_free( old_cwd );
-			old_cwd = NULL;
-		}
-		
 		i = bitlbee_daemon_init();
 		log_message( LOGLVL_INFO, "Bitlbee %s starting in forking daemon mode.", BITLBEE_VERSION );
@@ -118,33 +107,4 @@
 	
 	g_main_run( global.loop );
-	
-	if( global.restart )
-	{
-		char *fn = ipc_master_save_state();
-		char **args;
-		int n, i;
-		
-		chdir( old_cwd );
-		
-		n = 0;
-		args = g_new0( char *, argc + 3 );
-		args[n++] = argv[0];
-		if( fn )
-		{
-			args[n++] = "-R";
-			args[n++] = fn;
-		}
-		for( i = 1; argv[i] && i < argc; i ++ )
-		{
-			if( strcmp( argv[i], "-R" ) == 0 )
-				i += 2;
-			
-			args[n++] = argv[i];
-		}
-		
-		close( global.listen_socket );
-		
-		execve( args[0], args, envp );
-	}
 	
 	return( 0 );
