Skip to content

Commit

Permalink
Add EEXIST to common host errors, don't fail when creating directories
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Aug 30, 2024
1 parent d30afec commit 50bd736
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int FileSystem::makedirs(const char* path)
while((i = s.indexOf('/', i)) > 0) {
s[i] = '\0';
int err = mkdir(s.c_str());
if(err < 0) {
if(err < 0 && err != Error::Exists) {
return err;
}
s[i++] = '/';
Expand Down
2 changes: 2 additions & 0 deletions src/HostUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ int mapFlags(OpenFlags flags)
int syserr()
{
switch(errno) {
case EEXIST:
return Error::Exists;
case EPERM:
case EACCES:
return Error::Denied;
Expand Down

0 comments on commit 50bd736

Please sign in to comment.