Io: Consistently use error codes with OpenFile().

This gets rid of OpenWithError(), and just always returns a negative value
on error for OpenFile().  Also fixed the sequence rollover, which could've
returned 0.

0 should be considered a valid handle ideally, but left it never returning
0 to simplify cleanup in some areas.
This commit is contained in:
Unknown W. Brackets committed 2019-10-20 11:03:37 -07:00
1 parent 45516783f6
commit 913121cf2b
18 files changed
+80 -86

No files matched your search

+1 -1
View File
@@ -221,7 +221,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {
bool hasEncrypted = false;
u32 fd;
if ((fd = pspFileSystem.OpenFile(bootpath, FILEACCESS_READ)) != 0)
if ((fd = pspFileSystem.OpenFile(bootpath, FILEACCESS_READ)) >= 0)
{
u8 head[4];
pspFileSystem.ReadFile(fd, head, 4);