diff options
| author | bunnei <bunneidev@gmail.com> | 2016-03-20 16:11:49 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-03-20 16:11:49 -0400 |
| commit | b83e95727f95fa6fe35d436be3e821605244a6a8 (patch) | |
| tree | 64255c7432e882205a2dbea1fe962025863664ee /src/core/hle/service/cfg/cfg.cpp | |
| parent | ff6c24932a1d748f083adae66c58bf7ebc760535 (diff) | |
| parent | f707026ac50c53716ac697ed439630d7728e9db6 (diff) | |
Merge pull request #1302 from Subv/save_fix
HLE/FS: Fixed many corner cases in our file handling
Diffstat (limited to 'src/core/hle/service/cfg/cfg.cpp')
| -rw-r--r-- | src/core/hle/service/cfg/cfg.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 4c82a58e4..525432957 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -310,7 +310,8 @@ ResultCode UpdateConfigNANDSavegame() { ResultCode FormatConfig() { ResultCode res = DeleteConfigNANDSaveFile(); - if (!res.IsSuccess()) + // The delete command fails if the file doesn't exist, so we have to check that too + if (!res.IsSuccess() && res.description != ErrorDescription::FS_NotFound) return res; // Delete the old data cfg_config_file_buffer.fill(0); @@ -407,7 +408,7 @@ void Init() { // If the archive didn't exist, create the files inside if (archive_result.Code().description == ErrorDescription::FS_NotFormatted) { // Format the archive to create the directories - Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); + Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SystemSaveData, FileSys::ArchiveFormatInfo(), archive_path); // Open it again to get a valid archive now that the folder exists archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); |
