From c7f5475b5647e616f8da38112ee8e253beae850a Mon Sep 17 00:00:00 2001 From: Eladash Date: Mon, 6 Sep 2021 14:52:56 +0300 Subject: [PATCH] Improve sys_fs_close logging --- rpcs3/Emu/Cell/lv2/sys_fs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index baeefd5a4f..5c97684b91 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -727,13 +727,11 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd) ppu.state += cpu_flag::wait; lv2_obj::sleep(ppu); - sys_fs.trace("sys_fs_close(fd=%d)", fd); - const auto file = idm::get(fd); if (!file) { - return CELL_EBADF; + return {CELL_EBADF, fd}; } { @@ -741,7 +739,7 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd) if (!file->file) { - return CELL_EBADF; + return {CELL_EBADF, fd}; } if (!(file->mp->flags & (lv2_mp_flag::read_only + lv2_mp_flag::cache)) && file->flags & CELL_FS_O_ACCMODE) @@ -772,12 +770,14 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd) if (!ret || ret.ret == CELL_EBADF) { - return CELL_EBADF; + return {CELL_EBADF, fd}; } + sys_fs.warning("sys_fs_close(fd=%u): path='%s'", fd, file->name.data()); + if (file->lock == 1) { - return CELL_EBUSY; + return {CELL_EBUSY, fd}; } return CELL_OK;