commit: e1720c4f252f6deaf2ab7a7630232d9af238c9e0
parent ec3b5e474b82181350c2e1fade4827680c44fcc4
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 11 Jun 2024 09:27:37 +0200
cp-stub.c: Handle EEXIST from mkdir(2)
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/cp-stub.c b/cp-stub.c
@@ -89,8 +89,12 @@ do_copy(char *src, char *dest, bool multi_src)
if(mkdir(dest, mode|S_IRWXU) != 0)
{
- fprintf(stderr, "%s: Failed creating target directory '%s': %s\n", argv0, dest, strerror(errno));
- return -1;
+ if(errno != EEXIST)
+ {
+ fprintf(stderr, "%s: Failed creating target directory '%s': %s\n", argv0, dest, strerror(errno));
+ return -1;
+ }
+ else errno = 0;
}
if(preserve_metadata)