tPosition fd after snaphdr before walking snapshot entries - 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 28320f9a798150281e7192fe79cc1d48bdf9a4ae
(DIR) parent 4e65a16a45c87ef2b43c2ce799091b74c475211a
(HTM) Author: sin <sin@2f30.org>
Date: Wed, 27 Feb 2019 10:25:43 +0000
Position fd after snaphdr before walking snapshot entries
Diffstat:
M dedup.c | 4 ++++
1 file changed, 4 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/dedup.c b/dedup.c
t@@ -440,6 +440,7 @@ load_cache(void)
nr_entries = sb.st_size / CACHE_ENTRY_LEN;
if (nr_entries == 0) {
+ xlseek(ifd, SNAPHDR_LEN, SEEK_SET);
walk_snap(rebuild_cache, NULL);
return;
}
t@@ -587,12 +588,14 @@ main(int argc, char *argv[])
init();
if (cflag) {
+ xlseek(ifd, SNAPHDR_LEN, SEEK_SET);
walk_snap(check, NULL);
term();
return 0;
}
if (lflag) {
+ xlseek(ifd, SNAPHDR_LEN, SEEK_SET);
walk_snap(list, NULL);
term();
return 0;
t@@ -601,6 +604,7 @@ main(int argc, char *argv[])
if (id) {
struct extract_args args;
+ xlseek(ifd, SNAPHDR_LEN, SEEK_SET);
str2bin(id, md);
args.md = md;
args.fd = fd;