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;