mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 16:53:40 +01:00
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:
1 parent
45516783f6
commit
913121cf2b
18 files changed
+80
-86
No files matched your search
@@ -413,10 +413,13 @@ std::string GameManager::GetISOGameID(FileLoader *loader) const {
|
||||
ISOFileSystem umd(&handles, bd);
|
||||
|
||||
PSPFileInfo info = umd.GetFileInfo("/PSP_GAME/PARAM.SFO");
|
||||
int handle = 0;
|
||||
int handle = -1;
|
||||
if (info.exists) {
|
||||
handle = umd.OpenFile("/PSP_GAME/PARAM.SFO", FILEACCESS_READ);
|
||||
}
|
||||
if (handle < 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string sfoData;
|
||||
sfoData.resize(info.size);
|
||||
|
||||
Reference in new issue
Block a user