Io: Return error code for write attempt to UMD.

Previously, we were returning file not found (because 0), which was not
correct.  We were also allowing write handles to sce_lbn.
This commit is contained in:
Unknown W. Brackets 2019-10-20 10:36:13 -07:00
parent c7b3a08cf3
commit 45516783f6

View file

@ -335,6 +335,11 @@ u32 ISOFileSystem::OpenFile(std::string filename, FileAccess access, const char
entry.isRawSector = false;
entry.isBlockSectorMode = false;
if (access & FILEACCESS_WRITE) {
ERROR_LOG(FILESYS, "Can't open file %s with write access on an ISO partition", filename.c_str());
return SCE_KERNEL_ERROR_ERRNO_INVALID_FLAG;
}
if (filename.compare(0, 8, "/sce_lbn") == 0) {
// Raw sector read.
u32 sectorStart = 0xFFFFFFFF, readSize = 0xFFFFFFFF;
@ -364,11 +369,6 @@ u32 ISOFileSystem::OpenFile(std::string filename, FileAccess access, const char
return newHandle;
}
if (access & FILEACCESS_WRITE) {
ERROR_LOG(FILESYS, "Can't open file %s with write access on an ISO partition", filename.c_str());
return 0;
}
// May return entireISO for "umd0:"
entry.file = GetFromPath(filename);
if (!entry.file){