From: Wilfried Goesgens Date: Sun, 21 Aug 2011 20:28:36 +0000 (+0200) Subject: in some rare conditions, we seem to need to check the pointer first before accessing it. X-Git-Tag: v8.11~1006 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=e2da570b30294a512b50aa2f8f9725b34176c52f in some rare conditions, we seem to need to check the pointer first before accessing it. --- diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 1c7df5e9c..e9b7ad174 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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);