aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2023-11-20 22:31:56 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2023-11-20 22:31:56 -0500
commit1a75de6b9c1e821fc585e89eb466610c2cbc83b5 (patch)
tree0f66809355c527889024b154e1aa713c4e8c23fb /src
parent43bcd36bb31c1ab117b54f21746b119db2448449 (diff)
downloadstasis-1a75de6b9c1e821fc585e89eb466610c2cbc83b5.tar.gz
Do not produce an error if a path element exists during creation
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/copy.c b/src/copy.c
index fa623d2..b956894 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -102,6 +102,11 @@ int mkdirs(const char *_path, mode_t mode) {
strcat(result, token);
strcat(result, "/");
status = mkdir(result, mode);
+ if (status && errno == EEXIST) {
+ status = 0;
+ errno = 0;
+ continue;
+ }
}
return status;
}