Fix psf::load error for error::stream

This commit is contained in:
Nekotekina 2021-04-10 00:43:08 +03:00
parent 17f5fec538
commit 3107f37864
2 changed files with 6 additions and 4 deletions

View file

@ -602,7 +602,7 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
if (psf_error != psf::error::stream)
{
init.cancel();
return CELL_GAME_ERROR_BROKEN;
return {CELL_GAME_ERROR_BROKEN, psf_error};
}
}
@ -965,7 +965,7 @@ error_code cellGameDeleteGameData(vm::cptr<char> dirName)
if (psf::get_string(sfo, "CATEGORY") != "GD" && psf_error != psf::error::stream)
{
return CELL_GAME_ERROR_NOTSUPPORTED;
return {CELL_GAME_ERROR_NOTSUPPORTED, psf_error};
}
if (sfo.empty())

View file

@ -122,9 +122,11 @@ namespace psf
load_result_t load(const fs::file& stream)
{
#define PSF_CHECK(cond, err) if (!static_cast<bool>(cond)) { if (error::err != error::stream) psf_log.error("Error loading PSF: %s%s", (errc = error::err), \
#define PSF_CHECK(cond, err) if (!static_cast<bool>(cond)) { if (error::err != error::stream) psf_log.error("Error loading PSF: %s%s", error::err, \
src_loc{__builtin_LINE(), __builtin_COLUMN(), __builtin_FILE(), __builtin_FUNCTION()}); \
return result.clear(), pair; }
result.clear(); \
errc = error::err; \
return pair; }
load_result_t pair{};
auto& [result, errc] = pair;