Readd hack in posix_close

It's either this, or removing LLE DiscMap.
Or shadow implements posix sockets.
This commit is contained in:
Stephen Miller 2025-02-17 15:22:16 -06:00
parent 671cbfbbd0
commit 55790e37e8

View file

@ -182,6 +182,12 @@ s32 PS4_SYSV_ABI sceKernelOpen(const char* path, s32 flags, /* SceKernelMode*/ u
}
s32 PS4_SYSV_ABI posix_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;
}
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(fd);
if (file == nullptr) {