tCreate cache file if not present - 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 d52d93206950864179a0da2c44b5dd0528506213
(DIR) parent 947a779321210f9080b129607d83c444837a2083
(HTM) Author: sin <sin@2f30.org>
Date: Sat, 2 Mar 2019 13:03:26 +0000
Create cache file if not present
Diffstat:
M dedup.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/dedup.c b/dedup.c
t@@ -544,7 +544,11 @@ init(int iflag)
if (sfd < 0)
err(1, "open %s", STOREF);
- cfd = open(CACHEF, flags, 0600);
+ /*
+ * The cache file does not have to exist
+ * and will be created again if deleted.
+ */
+ cfd = open(CACHEF, O_RDWR | O_CREAT, 0600);
if (cfd < 0)
err(1, "open %s", CACHEF);