make sys_fs_closedir atomic

This commit is contained in:
eladash 2019-04-10 17:32:48 +03:00 committed by Nekotekina
parent 949f33c8a4
commit 1e5e0f3b5e

View File

@ -602,15 +602,11 @@ error_code sys_fs_closedir(ppu_thread& ppu, u32 fd)
sys_fs.warning("sys_fs_closedir(fd=%d)", fd);
const auto directory = idm::get<lv2_fs_object, lv2_dir>(fd);
if (!directory)
if (!idm::remove<lv2_fs_object, lv2_dir>(fd))
{
return CELL_EBADF;
}
idm::remove<lv2_fs_object, lv2_dir>(fd);
return CELL_OK;
}