]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
USE_TRUNCATE_NOT_UNLINK option
authorwessels <>
Wed, 2 Dec 1998 12:07:25 +0000 (12:07 +0000)
committerwessels <>
Wed, 2 Dec 1998 12:07:25 +0000 (12:07 +0000)
src/store_rebuild.cc
src/unlinkd.cc

index c50c9f46279aa2e8599308c7e4ec4d4c96e7373e..b2211434e0deb9d59ecb58a88ea2af2ec3ca845a 100644 (file)
@@ -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");
index f8fc97bdab56a14fc4c3f92fdf692cfd803b6f32..d68f87080cbb14e85f255d2e5da91e657b181ecb 100644 (file)
@@ -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);
 }