From: wessels <> Date: Tue, 24 Oct 2006 10:48:10 +0000 (+0000) Subject: Alex reports getting coredumps (with high debugging) at process X-Git-Tag: SQUID_3_0_PRE5~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cfa98cb1363eee90d12d762b84b67d98aec2f35;p=thirdparty%2Fsquid.git Alex reports getting coredumps (with high debugging) at process exit because debug_log got closed, but was not set to NULL. Seems like we should not call fclose() before exit so that destructors can write debugging if necessary. The file will be closed anyway when the process truly exits. --- diff --git a/src/main.cc b/src/main.cc index 8c7c6300cb..164d79f42f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.437 2006/09/25 15:04:07 adrian Exp $ + * $Id: main.cc,v 1.438 2006/10/24 04:48:10 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -1733,8 +1733,16 @@ SquidShutdown() debug(1, 1) ("Squid Cache (Version %s): Exiting normally.\n", version_string); - if (debug_log) - fclose(debug_log); + /* + * DPW 2006-10-23 + * We used to fclose(debug_log) here if it was set, but then + * we forgot to set it to NULL. That caused some coredumps + * because exit() ends up calling a bunch of destructors and + * such. So rather than forcing the debug_log to close, we'll + * leave it open so that those destructors can write some + * debugging if necessary. The file will be closed anyway when + * the process truly exits. + */ exit(shutdown_status); }