seek inside walk_snap() - 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 1b1447f899bb2dc4b78ec0b915c71343009ca9c5 DIR parent 1ba4afc35229c3ea9fcb421dfcde63d87a39f227 HTML Author: sin <sin@2f30.org> Date: Sat, 9 Mar 2019 21:58:03 +0000 seek inside walk_snap() It is less error prone to do it this way. Diffstat: M dedup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- DIR diff --git a/dedup.c b/dedup.c @@ -377,6 +377,7 @@ walk_snap(int (*fn)(struct snapshot *, void *), void *arg) { uint64_t i; + xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET); for (i = 0; i < snap_hdr.nr_snapshots; i++) { struct snapshot *snap; int ret; @@ -588,7 +589,6 @@ main(int argc, char *argv[]) if (cflag) { int ret; - xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET); ret = 0; walk_snap(check_snap, &ret); if (ret != 0) @@ -599,7 +599,6 @@ main(int argc, char *argv[]) } if (lflag) { - xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET); walk_snap(list, NULL); term(); return 0; @@ -608,7 +607,6 @@ main(int argc, char *argv[]) if (id) { struct extract_args args; - xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET); str2bin(id, md); args.md = md; args.fd = fd;