mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-29 14:53:18 +00:00
Only log fd warning if there's a file getting closed (#2737)
This commit is contained in:
parent
9ee5d066a2
commit
f6cc245e40
1 changed files with 4 additions and 4 deletions
|
@ -190,16 +190,16 @@ s32 PS4_SYSV_ABI sceKernelOpen(const char* path, s32 flags, /* SceKernelMode*/ u
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI close(s32 fd) {
|
s32 PS4_SYSV_ABI close(s32 fd) {
|
||||||
if (fd < 3) {
|
|
||||||
// This is technically possible, but it's usually caused by some stubbed function instead.
|
|
||||||
LOG_WARNING(Kernel_Fs, "called on an std handle, fd = {}", fd);
|
|
||||||
}
|
|
||||||
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
||||||
auto* file = h->GetFile(fd);
|
auto* file = h->GetFile(fd);
|
||||||
if (file == nullptr) {
|
if (file == nullptr) {
|
||||||
*__Error() = POSIX_EBADF;
|
*__Error() = POSIX_EBADF;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (fd < 3) {
|
||||||
|
// This is technically possible, but it's usually caused by some stubbed function instead.
|
||||||
|
LOG_WARNING(Kernel_Fs, "called on an std handle, fd = {}", fd);
|
||||||
|
}
|
||||||
if (file->type == Core::FileSys::FileType::Regular) {
|
if (file->type == Core::FileSys::FileType::Regular) {
|
||||||
file->f.Close();
|
file->f.Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue