tCall sodium_init() - 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 3ae183aa99bba33b67a2f59447e1e835104b629b
(DIR) parent 7d0e3db7c6c61fdea091bccb1d8a8e61545be235
(HTM) Author: sin <sin@2f30.org>
Date: Wed, 1 May 2019 22:19:30 +0100
Call sodium_init()
Diffstat:
M bstorage.c | 6 ++++++
1 file changed, 6 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/bstorage.c b/bstorage.c
t@@ -289,6 +289,9 @@ bscreat(struct bctx *bctx, char *path, int mode, struct bparam *bpar)
struct bhdr *bhdr;
int fd;
+ if (sodium_init() < 0)
+ return -1;
+
fd = open(path, O_RDWR | O_CREAT | O_EXCL, mode);
if (fd < 0)
return -1;
t@@ -348,6 +351,9 @@ bsopen(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar)
return -1;
}
+ if (sodium_init() < 0)
+ return -1;
+
fd = open(path, flags, mode);
if (fd < 0)
return -1;