mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
sys_fs: always close locked file in sys_fs_close
Syscall returns EBUSY but succeeds nevertheless.
This commit is contained in:
parent
a005090d3d
commit
e2512e78b6
1 changed files with 3 additions and 11 deletions
|
@ -515,24 +515,16 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd)
|
||||||
|
|
||||||
sys_fs.trace("sys_fs_close(fd=%d)", fd);
|
sys_fs.trace("sys_fs_close(fd=%d)", fd);
|
||||||
|
|
||||||
const auto file = idm::withdraw<lv2_fs_object, lv2_file>(fd, [](lv2_file& file) -> CellError
|
const auto file = idm::withdraw<lv2_fs_object, lv2_file>(fd);
|
||||||
{
|
|
||||||
if (file.lock == 1)
|
|
||||||
{
|
|
||||||
return CELL_EBUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
return CELL_EBADF;
|
return CELL_EBADF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.ret)
|
if (file->lock == 1)
|
||||||
{
|
{
|
||||||
return file.ret;
|
return CELL_EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue