Add term() and free ent - 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 13378070bffa75c90083946564108ed815a68e5a
DIR parent 53e9db19eac9711cda7a658131d9cb1b42892113
HTML Author: sin <sin@2f30.org>
Date: Tue, 20 Mar 2018 16:45:13 +0000
Add term() and free ent
Diffstat:
M dedup.c | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
---
DIR diff --git a/dedup.c b/dedup.c
@@ -201,6 +201,7 @@ dedup(int fd)
SHA256_Final(ent->md, &ctx);
append_ent(ent);
+ free(ent);
}
void
@@ -262,6 +263,15 @@ init(void)
}
void
+term(void)
+{
+ fsync(ifd);
+ fsync(sfd);
+ close(ifd);
+ close(sfd);
+}
+
+void
dump_index(void)
{
struct ent *ent;
@@ -317,4 +327,6 @@ main(int argc, char *argv[])
extract(id, 0);
else
dedup(0);
+
+ term();
}