fixed sceKernelClose when decriptor is negative value

This commit is contained in:
georgemoralis 2024-06-08 09:56:57 +03:00
parent 3b34aebe06
commit 8115665a90
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ int PS4_SYSV_ABI posix_open(const char* path, int flags, /* SceKernelMode*/ u16
}
int PS4_SYSV_ABI sceKernelClose(int d) {
if (d < 3) { // d probably hold an error code
return ORBIS_KERNEL_ERROR_EPERM;
}
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(d);
if (file == nullptr) {