From 2333b2d5d3dcee7e078d431af0a12d235750825d Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Tue, 25 Mar 2025 17:24:44 -0500 Subject: [PATCH] Remove close hack Since LLE libSceDiscMap is no longer a concern, this hack shouldn't be needed. Since sockets are still stubbed, and close can be used on sockets, I've added a warning log just in case this still occurs in some titles. --- src/core/libraries/kernel/file_system.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index dc13b6721..4d9b7d846 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -190,11 +190,9 @@ s32 PS4_SYSV_ABI sceKernelOpen(const char* path, s32 flags, /* SceKernelMode*/ u } s32 PS4_SYSV_ABI close(s32 fd) { - if (fd == 0) { - // Hack to bypass unimplemented posix_socket in LLE libSceDiscMap - // Without this, it closes stdin because socket returns fd 0 - *__Error() = POSIX_EBADF; - 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); } auto* h = Common::Singleton::Instance(); auto* file = h->GetFile(fd);