From: wessels <> Date: Wed, 2 Dec 1998 12:07:25 +0000 (+0000) Subject: USE_TRUNCATE_NOT_UNLINK option X-Git-Tag: SQUID_3_0_PRE1~2490 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db25be83f3de86bb57bed767b6c377acf361bfe7;p=thirdparty%2Fsquid.git USE_TRUNCATE_NOT_UNLINK option --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index c50c9f4627..b2211434e0 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -1,6 +1,6 @@ /* - * $Id: store_rebuild.cc,v 1.52 1998/10/09 17:46:37 wessels Exp $ + * $Id: store_rebuild.cc,v 1.53 1998/12/02 05:07:25 wessels Exp $ * * DEBUG: section 20 Store Rebuild Routines * AUTHOR: Duane Wessels @@ -155,6 +155,10 @@ storeRebuildFromDirectory(rebuild_dir * d) file_close(fd); fd = -1; swap_hdr_len = 0; +#if USE_TRUNCATE_NOT_UNLINK + if (sb.st_size == 0) + continue; +#endif tlv_list = storeSwapMetaUnpack(hdr_buf, &swap_hdr_len); if (tlv_list == NULL) { debug(20, 1) ("storeRebuildFromDirectory: failed to get meta data\n"); diff --git a/src/unlinkd.cc b/src/unlinkd.cc index f8fc97bdab..d68f87080c 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,5 +1,5 @@ /* - * $Id: unlinkd.cc,v 1.28 1998/09/15 19:38:06 wessels Exp $ + * $Id: unlinkd.cc,v 1.29 1998/12/02 05:07:26 wessels Exp $ * * DEBUG: section 12 Unlink Daemon * AUTHOR: Duane Wessels @@ -67,7 +67,11 @@ main(int argc, char *argv[]) while (fgets(buf, UNLINK_BUF_LEN, stdin)) { if ((t = strchr(buf, '\n'))) *t = '\0'; +#if USE_TRUNCATE_NOT_UNLINK + truncate(buf, 0); +#else unlink(buf); +#endif } exit(0); }