Skip to content

Commit

Permalink
XrdS3: fix makePath implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
apeters1971 committed Sep 30, 2024
1 parent 9503b6a commit eee57d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/XrdS3/XrdS3Utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,14 @@ int S3Utils::makePath(char *path, mode_t mode) {
//
while ((next_path = index(next_path, int('/')))) {
*next_path = '\0';
if (XrdPosix_Mkdir(path, mode))
if (errno != EEXIST) return errno;
if (!XrdPosix_Stat(path, &buf)) {
if (!S_ISDIR(buf.st_mode)) {
return ENOTDIR;
}
} else {
if (XrdPosix_Mkdir(path, mode))
if (errno != EEXIST) return errno;
}
*next_path = '/';
next_path = next_path + 1;
}
Expand Down

0 comments on commit eee57d3

Please sign in to comment.