tTruncate cache before reloading it - dedup - deduplicating backup program
(HTM) git clone git://git.z3bra.org/dedup.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 9e6393b24468ea6887fa8a703f4e4b4f939e53fb
(DIR) parent 31bcb5d7c375ac842c005579961586d42e019e7b
(HTM) Author: sin <sin@2f30.org>
Date: Tue, 5 Mar 2019 12:02:40 +0000
Truncate cache before reloading it
Diffstat:
M dedup.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/dedup.c b/dedup.c
t@@ -553,6 +553,8 @@ load_cache(void)
if (nr_entries != snap_hdr.st.nr_blks) {
if (verbose > 0)
fprintf(stderr, "Rebuilding cache\n");
+ if (ftruncate(cfd, 0) < 0)
+ err(1, "ftruncate");
xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET);
walk_snap(reload_cache, NULL);
return;