Earlier ro check in posix_rmdir

Hardware tests suggest these checks are in a different order
This commit is contained in:
Stephen Miller 2025-04-28 12:31:27 -05:00
parent 5f3da89091
commit 384e036533

View File

@ -500,13 +500,13 @@ s32 PS4_SYSV_ABI posix_rmdir(const char* path) {
const std::filesystem::path dir_name = mnt->GetHostPath(path, &ro);
if (dir_name.empty() || !std::filesystem::is_directory(dir_name)) {
*__Error() = POSIX_ENOTDIR;
if (ro) {
*__Error() = POSIX_EROFS;
return -1;
}
if (ro) {
*__Error() = POSIX_EROFS;
if (dir_name.empty() || !std::filesystem::is_directory(dir_name)) {
*__Error() = POSIX_ENOTDIR;
return -1;
}