From e2512e78b6711abd1cd2bd9d00882f264e76b765 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 16 Jan 2020 22:10:08 +0300 Subject: [PATCH] sys_fs: always close locked file in sys_fs_close Syscall returns EBUSY but succeeds nevertheless. --- rpcs3/Emu/Cell/lv2/sys_fs.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index aba940e268..f3a7fff021 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -515,24 +515,16 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd) sys_fs.trace("sys_fs_close(fd=%d)", fd); - const auto file = idm::withdraw(fd, [](lv2_file& file) -> CellError - { - if (file.lock == 1) - { - return CELL_EBUSY; - } - - return {}; - }); + const auto file = idm::withdraw(fd); if (!file) { return CELL_EBADF; } - if (file.ret) + if (file->lock == 1) { - return file.ret; + return CELL_EBUSY; } return CELL_OK;