in some rare conditions, we seem to need to check the pointer first before accessing it.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Aug 2011 20:28:36 +0000 (22:28 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Aug 2011 20:28:36 +0000 (22:28 +0200)
citadel/sysdep.c

index 1c7df5e9c4857333406d8e68a7aa3a96cf57bc4c..e9b7ad1749fdb6b9d895939506185d077e3ddc2a 100644 (file)
@@ -180,9 +180,11 @@ volatile int restart_server = 0;
 volatile int running_as_daemon = 0;
 
 static RETSIGTYPE signal_cleanup(int signum) {
+       ThreadTSD *Cc;
 
-       if (CT)
-               CT->signal = signum;
+       Cc = CTP;
+       if (Cc && Cc->self)
+               Cc->self->signal = signum;
        else
        {
                CtdlLogPrintf(CTDL_DEBUG, "Caught signal %d; shutting down.\n", signum);