From 83fd8dfa11bc66448face117fbeff435485eae17 Mon Sep 17 00:00:00 2001 From: codemastr Date: Mon, 17 Jan 2005 19:33:46 +0000 Subject: [PATCH] Fixed a problem where doing ./unreal restart multiple times would not actually restart the ircd --- Changes | 3 +++ src/ircd.c | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 36e931159..af1ff97e1 100644 --- a/Changes +++ b/Changes @@ -530,3 +530,6 @@ - Made the win32 installer include the dccallow.conf (#0002269) reported by Ron2K. - Made the win32 installer work with the latest version of Inno Setup (5.0.6). - Made /sajoin support multiple channels and using 0 (#0002231) suggested by acemi. +- Fixed a problem where doing ./unreal restart multiple times would not actually restart + the ircd (#0002120) reported by SineSwiper. + diff --git a/src/ircd.c b/src/ircd.c index af6288085..9c40897e1 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -173,7 +173,7 @@ int debuglevel = 10; /* Server debug level */ int bootopt = 0; /* Server boot option flags */ char *debugmode = ""; /* -"- -"- -"- */ char *sbrk0; /* initial sbrk(0) */ -static int dorehash = 0; +static int dorehash = 0, dorestart = 0; static char *dpath = DPATH; MODVAR int booted = FALSE; MODVAR TS nextconnect = 1; /* time for next try_connections call */ @@ -270,6 +270,8 @@ void restart(char *mesg) VOIDSIG s_restart() { + dorestart = 1; +#if 0 static int restarting = 0; if (restarting == 0) { @@ -280,6 +282,7 @@ VOIDSIG s_restart() restarting = 1; server_reboot("SIGINT"); } +#endif } @@ -1579,10 +1582,16 @@ void SocketLoop(void *dummy) if ((timeofday >= nextping && !lifesux) || loop.do_bancheck) #endif nextping = check_pings(timeofday); - if (dorehash) { + if (dorehash) + { (void)rehash(&me, &me, 1); dorehash = 0; } + if (dorestart) + { + server_reboot("SIGINT"); + } + /* * ** Flush output buffers on all connections timeofday if they * ** have data in them (or at least try to flush)