tAdd term() and free ent - 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 13378070bffa75c90083946564108ed815a68e5a
(DIR) parent 53e9db19eac9711cda7a658131d9cb1b42892113
(HTM) 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
t@@ -201,6 +201,7 @@ dedup(int fd)
SHA256_Final(ent->md, &ctx);
append_ent(ent);
+ free(ent);
}
void
t@@ -262,6 +263,15 @@ init(void)
}
void
+term(void)
+{
+ fsync(ifd);
+ fsync(sfd);
+ close(ifd);
+ close(sfd);
+}
+
+void
dump_index(void)
{
struct ent *ent;
t@@ -317,4 +327,6 @@ main(int argc, char *argv[])
extract(id, 0);
else
dedup(0);
+
+ term();
}