From: Amos Jeffries Date: Thu, 22 May 2008 12:05:45 +0000 (+1200) Subject: Silence secondary errors on fatal shutdowns. X-Git-Tag: SQUID_3_1_0_1~49^2~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=634243ef25171d360c1659c209da8d41e657fae2;p=thirdparty%2Fsquid.git Silence secondary errors on fatal shutdowns. This patch causes fatal() errors to set the shutdown flag before aborting. The result of this is that secondary errors not related to the fatal condition but caused during the shutdown sequence no longer confuse the error traces. It also cleans up a little broken whitespace formatting in the snmp_core.cc --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index f28d3bdf2b..5a57973f5d 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -445,7 +445,8 @@ snmpConnectionShutdown(void) * and 'out' sockets might be just one FD. This prevents this * function from executing repeatedly. When we are really ready to * exit or restart, main will comm_close the 'out' descriptor. - */ theInSnmpConnection = -1; + */ + theInSnmpConnection = -1; /* * Normally we only write to the outgoing SNMP socket, but we @@ -466,6 +467,8 @@ snmpConnectionClose(void) if (theOutSnmpConnection > -1) { debugs(49, 1, "FD " << theOutSnmpConnection << " Closing SNMP socket"); comm_close(theOutSnmpConnection); + /* make sure the SNMP out connection is unset */ + theOutSnmpConnection = -1; } } diff --git a/src/tools.cc b/src/tools.cc index a076b09f97..178994eaf2 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -461,6 +461,9 @@ fatal_common(const char *message) void fatal(const char *message) { + /* suppress secondary errors from the dying */ + shutting_down = 1; + releaseServerSockets(); /* check for store_dirs_rebuilding because fatal() is often * used in early initialization phases, long before we ever