From f707026ac50c53716ac697ed439630d7728e9db6 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 3 Mar 2016 13:05:50 -0500 Subject: HLE/FS: Change the error code returned when an ExtSaveData archive is not found. This allows Fire Emblem to boot again. --- src/core/file_sys/archive_savedata.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/file_sys/archive_savedata.cpp') diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index c2d32ed7e..fe020d21c 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -77,15 +77,15 @@ ResultVal ArchiveFactory_SaveData::GetFormatInfo(const Path& std::string metadata_path = GetSaveDataMetadataPath(mount_point, Kernel::g_current_process->codeset->program_id); FileUtil::IOFile file(metadata_path, "rb"); - if (file.IsOpen()) { - ArchiveFormatInfo info; - file.ReadBytes(&info, sizeof(info)); - return MakeResult(info); + if (!file.IsOpen()) { + LOG_ERROR(Service_FS, "Could not open metadata information for archive"); + // TODO(Subv): Verify error code + return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, ErrorSummary::InvalidState, ErrorLevel::Status); } - LOG_ERROR(Service_FS, "Could not open metadata information for archive"); - // TODO(Subv): Verify error code - return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, ErrorSummary::InvalidState, ErrorLevel::Status); + ArchiveFormatInfo info = {}; + file.ReadBytes(&info, sizeof(info)); + return MakeResult(info); } } // namespace FileSys -- cgit v1.2.3