Skip to content

Commit

Permalink
Implement fs::error::notempty
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Sep 13, 2017
1 parent 22d8b57 commit 669d953
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Utilities/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static fs::error to_error(DWORD e)
case ERROR_DIRECTORY: return fs::error::inval;
case ERROR_INVALID_NAME: return fs::error::inval;
case ERROR_SHARING_VIOLATION: return fs::error::acces;
case ERROR_DIR_NOT_EMPTY: return fs::error::notempty;
default: fmt::throw_exception("Unknown Win32 error: %u.", e);
}
}
Expand Down Expand Up @@ -128,6 +129,7 @@ static fs::error to_error(int e)
case EEXIST: return fs::error::exist;
case EINVAL: return fs::error::inval;
case EACCES: return fs::error::acces;
case ENOTEMPTY: return fs::error::notempty;
default: fmt::throw_exception("Unknown system error: %d.", e);
}
}
Expand Down Expand Up @@ -1449,6 +1451,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::noent: return "Not found";
case fs::error::exist: return "Already exists";
case fs::error::acces: return "Access violation";
case fs::error::notempty: return "Not empty";
}

return unknown;
Expand Down
1 change: 1 addition & 0 deletions Utilities/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ namespace fs
noent,
exist,
acces,
notempty,
};

// Error code returned
Expand Down
1 change: 1 addition & 0 deletions rpcs3/Emu/Cell/lv2/sys_fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ error_code sys_fs_rmdir(vm::cptr<char> path)
switch (auto error = fs::g_tls_error)
{
case fs::error::noent: return {CELL_ENOENT, path};
case fs::error::notempty: return {CELL_ENOTEMPTY, path};
default: sys_fs.error("sys_fs_rmdir(): unknown error %s", error);
}

Expand Down

0 comments on commit 669d953

Please sign in to comment.