Fix dup-init so the repo can be created in the current directory - 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 494ad19401db718a4806e5cf65f6bb6916927bc0 DIR parent 05438fee31a525193b6f776bfb2962e7c0275596 HTML Author: sin <sin@2f30.org> Date: Mon, 20 May 2019 13:57:55 +0300 Fix dup-init so the repo can be created in the current directory Diffstat: M dup-init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- DIR diff --git a/dup-init.c b/dup-init.c @@ -2,6 +2,7 @@ #include <sys/stat.h> #include <err.h> +#include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdint.h> @@ -126,7 +127,7 @@ main(int argc, char *argv[]) repo, STORAGEPATH) >= sizeof(bpath)) errx(1, "snprintf: %s: path too long", bpath); - if (mkdir(repo, 0700) < 0) + if (mkdir(repo, 0700) < 0 && errno != EEXIST) err(1, "mkdir: %s", repo); if ((lfd = lockrepo(repo)) < 0)