From: wessels <> Date: Wed, 14 Mar 2001 02:11:25 +0000 (+0000) Subject: sd->log.open() and sd->log.close() are NULL for the "null" storage X-Git-Tag: SQUID_3_0_PRE1~1570 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abc3bcd690cad10c4c8274caeea65b4ab412b357;p=thirdparty%2Fsquid.git sd->log.open() and sd->log.close() are NULL for the "null" storage system. The code was assuming that these functions are defined for all storage types. That caused coredumps upon reconfigure. Now only call those functions if non-NULL. --- diff --git a/src/store_dir.cc b/src/store_dir.cc index adbd479393..4066203acb 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.127 2001/02/23 20:59:51 hno Exp $ + * $Id: store_dir.cc,v 1.128 2001/03/13 19:11:25 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -334,7 +334,8 @@ storeDirOpenSwapLogs(void) SwapDir *sd; for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) { sd = &Config.cacheSwap.swapDirs[dirn]; - sd->log.open(sd); + if (sd->log.open) + sd->log.open(sd); } } @@ -345,7 +346,8 @@ storeDirCloseSwapLogs(void) SwapDir *sd; for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) { sd = &Config.cacheSwap.swapDirs[dirn]; - sd->log.close(sd); + if (sd->log.close) + sd->log.close(sd); } }