From: wessels <> Date: Tue, 5 Dec 2000 16:11:24 +0000 (+0000) Subject: Argh, that last patch to src/store_dir.c is bogus. sd->log.clean.done X-Git-Tag: SQUID_3_0_PRE1~1745 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7d542ee53bac8486db7d8b11d25dcb1b7aea370;p=thirdparty%2Fsquid.git Argh, that last patch to src/store_dir.c is bogus. sd->log.clean.done will never be NULL, it's sd->log.clean.state that's the problem. Also, this way I get to fix it in four files, not just one. --- diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index b5e27d5df4..372f8e1780 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.19 2000/11/30 20:12:46 wessels Exp $ + * $Id: store_dir_aufs.cc,v 1.20 2000/12/05 09:11:30 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1051,6 +1051,8 @@ static void storeAufsDirWriteCleanDone(SwapDir * sd) { struct _clean_state *state = sd->log.clean.state; + if (NULL == state) + return; if (state->fd < 0) return; state->walker->Done(state->walker); diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 1c1943e950..dc876ae987 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.10 2000/11/30 20:08:50 wessels Exp $ + * $Id: store_dir_coss.cc,v 1.11 2000/12/05 09:11:31 wessels Exp $ * * DEBUG: section 81 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -551,6 +551,8 @@ static void storeCossDirWriteCleanDone(SwapDir * sd) { struct _clean_state *state = sd->log.clean.state; + if (NULL == state) + return; if (state->fd < 0) return; if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) { diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index c0b36eadba..020dce40e4 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.26 2000/11/30 20:08:50 wessels Exp $ + * $Id: store_dir_diskd.cc,v 1.27 2000/12/05 09:11:31 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1245,6 +1245,8 @@ static void storeDiskdDirWriteCleanDone(SwapDir * sd) { struct _clean_state *state = sd->log.clean.state; + if (NULL == state) + return; if (state->fd < 0) return; state->walker->Done(state->walker); diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index cf80edace6..a7fd5ab9ad 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.16 2000/11/30 20:08:51 wessels Exp $ + * $Id: store_dir_ufs.cc,v 1.17 2000/12/05 09:11:34 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1049,6 +1049,8 @@ static void storeUfsDirWriteCleanDone(SwapDir * sd) { struct _clean_state *state = sd->log.clean.state; + if (NULL == state) + return; if (state->fd < 0) return; state->walker->Done(state->walker); diff --git a/src/store_dir.cc b/src/store_dir.cc index b502b78e93..0cce350b4a 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.116 2000/12/05 09:03:31 wessels Exp $ + * $Id: store_dir.cc,v 1.117 2000/12/05 09:11:24 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -401,8 +401,7 @@ storeDirWriteCleanLogs(int reopen) /* Flush */ for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) { sd = &Config.cacheSwap.swapDirs[dirn]; - if (sd->log.clean.done) - sd->log.clean.done(sd); + sd->log.clean.done(sd); } if (reopen) storeDirOpenSwapLogs();