summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index e274e2504..beb488d23 100644
--- a/src/main.c
+++ b/src/main.c
@@ -276,7 +276,7 @@ static void services_shutdown(void)
}
send_event(EVENT_SHUTDOWN, 1, EVENT_STOP);
disconn(servsock);
- modules_unload_all(true); /* Only legitimate use of this function */
+ modules_unload_all(true); /* Only legitimate use of this function */
}
/*************************************************************************/
@@ -285,6 +285,11 @@ static void services_shutdown(void)
void sighandler(int signum)
{
+ /* We set the quit message to something default, just to be sure it is
+ * always set when we need it. It seems some signals slip through to the
+ * QUIT code without having a valid quitmsg. -GD
+ */
+ quitmsg = sstrdup("Signal Received");
if (started) {
#ifndef _WIN32
if (signum == SIGHUP) { /* SIGHUP = save databases and restart */
@@ -356,7 +361,7 @@ void sighandler(int signum)
inbuf[448] = 0;
}
wallops(NULL, "PANIC! buffer = %s\r\n", inbuf);
- modules_unload_all(false);
+ modules_unload_all(false);
} else if (waiting < 0) {
/* This is static on the off-chance we run low on stack */
static char buf[BUFSIZE];
@@ -414,7 +419,7 @@ void sighandler(int signum)
}
wallops(NULL, "PANIC! %s (%s)", buf, strsignal(signum));
alog("PANIC! %s (%s)", buf, strsignal(signum));
- modules_unload_all(false);
+ modules_unload_all(false);
}
}
@@ -436,7 +441,7 @@ void sighandler(int signum)
if (signum == SIGSEGV) {
do_backtrace(1);
- modules_unload_all(false); /* probably cant do this, but might as well try, we have nothing left to loose */
+ modules_unload_all(false); /* probably cant do this, but might as well try, we have nothing left to loose */
}
/* Should we send the signum here as well? -GD */
send_event(EVENT_SIGNAL, 1, quitmsg);