Check mkdir() return value - 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 62e3b353d4deb68012b257e9debc351ddf454769
DIR parent 81c2c0671a98a4ff22a1d95fd302e6a3c35898a8
HTML Author: sin <sin@2f30.org>
Date: Fri, 3 May 2019 16:33:20 +0100
Check mkdir() return value
Diffstat:
M dup-init.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
DIR diff --git a/dup-init.c b/dup-init.c
@@ -78,11 +78,13 @@ main(int argc, char *argv[])
bpar.key = NULL;
}
- mkdir(repo, 0700);
+ if (mkdir(repo, 0700) < 0)
+ err(1, "mkdir: %s", repo);
if (chdir(repo) < 0)
err(1, "chdir: %s", repo);
- mkdir(ARCHIVEPATH, 0700);
+ if (mkdir(ARCHIVEPATH, 0700) < 0)
+ err(1, "mkdir: %s", ARCHIVEPATH);
if (bcreat(STORAGEPATH, 0600, &bpar, &bctx) < 0)
berr("bcreat: %s", STORAGEPATH);
if (bclose(bctx) < 0)