Truncate cache before reloading it - dedup - deduplicating backup program HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 9e6393b24468ea6887fa8a703f4e4b4f939e53fb DIR parent 31bcb5d7c375ac842c005579961586d42e019e7b HTML 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 @@ -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;