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.
This commit is contained in:
Stephen Miller 2025-03-25 17:24:44 -05:00
parent 2f91016345
commit 2333b2d5d3

View File

@ -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<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(fd);