From 8fa24045b1501e310fada3f0468f976cd66004ef Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 15 Oct 2022 20:55:26 -0700 Subject: [PATCH] Io: Fail open earlier from ms0: w/ no access flags. The PSP returns this error code if you use 0 for the open flags on ms0:/. --- Core/FileSystems/DirectoryFileSystem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index af8ea370a4..b2ae2fabb7 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -115,6 +115,11 @@ Path DirectoryFileSystem::GetLocalPath(std::string internalPath) const { bool DirectoryFileHandle::Open(const Path &basePath, std::string &fileName, FileAccess access, u32 &error) { error = 0; + if (access == FILEACCESS_NONE) { + error = SCE_KERNEL_ERROR_ERRNO_INVALID_ARGUMENT; + return false; + } + #if HOST_IS_CASE_SENSITIVE if (access & (FILEACCESS_APPEND | FILEACCESS_CREATE | FILEACCESS_WRITE)) { DEBUG_LOG(FILESYS, "Checking case for path %s", fileName.c_str());