summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2023-06-04 13:24:47 -0700
committerGravatar GitHub2023-06-04 13:24:47 -0700
commite6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28 (patch)
treef176c53f6cd6be36f6f18f86adf16c5d531f4eda /src
parentMerge pull request #10588 from liamwhite/vfs-cached (diff)
parentfsp-srv: avoid patching romfs multiple times (diff)
downloadyuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.gz
yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.xz
yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.zip
Merge pull request #10594 from liamwhite/double-patch
fsp-srv: avoid patching romfs multiple times
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index f73a864c3..427dbc8b3 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -968,16 +968,20 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(HLERequ
968void FSP_SRV::OpenDataStorageByCurrentProcess(HLERequestContext& ctx) { 968void FSP_SRV::OpenDataStorageByCurrentProcess(HLERequestContext& ctx) {
969 LOG_DEBUG(Service_FS, "called"); 969 LOG_DEBUG(Service_FS, "called");
970 970
971 auto current_romfs = fsc.OpenRomFSCurrentProcess(); 971 if (!romfs) {
972 if (current_romfs.Failed()) { 972 auto current_romfs = fsc.OpenRomFSCurrentProcess();
973 // TODO (bunnei): Find the right error code to use here 973 if (current_romfs.Failed()) {
974 LOG_CRITICAL(Service_FS, "no file system interface available!"); 974 // TODO (bunnei): Find the right error code to use here
975 IPC::ResponseBuilder rb{ctx, 2}; 975 LOG_CRITICAL(Service_FS, "no file system interface available!");
976 rb.Push(ResultUnknown); 976 IPC::ResponseBuilder rb{ctx, 2};
977 return; 977 rb.Push(ResultUnknown);
978 return;
979 }
980
981 romfs = current_romfs.Unwrap();
978 } 982 }
979 983
980 auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); 984 auto storage = std::make_shared<IStorage>(system, romfs);
981 985
982 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 986 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
983 rb.Push(ResultSuccess); 987 rb.Push(ResultSuccess);