dedup

small dedup program
git clone git://git.2f30.org/dedup.git
Log | Files | Refs | LICENSE

commit 13378070bffa75c90083946564108ed815a68e5a
parent 53e9db19eac9711cda7a658131d9cb1b42892113
Author: sin <sin@2f30.org>
Date:   Tue, 20 Mar 2018 16:45:13 +0000

Add term() and free ent

Diffstat:
dedup.c | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

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(); }