diff options
author | bunnei <bunneidev@gmail.com> | 2023-06-04 22:24:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-04 22:24:47 +0200 |
commit | e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28 (patch) | |
tree | f176c53f6cd6be36f6f18f86adf16c5d531f4eda /src/core/hle | |
parent | Merge pull request #10588 from liamwhite/vfs-cached (diff) | |
parent | fsp-srv: avoid patching romfs multiple times (diff) | |
download | yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.gz yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.bz2 yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.lz yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.xz yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.tar.zst yuzu-e6fce1cbbdd5ffb95c11b1fb3c43e8bdbe16ec28.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 20 |
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 void FSP_SRV::OpenDataStorageByCurrentProcess(HLERequestContext& ctx) { LOG_DEBUG(Service_FS, "called"); - auto current_romfs = fsc.OpenRomFSCurrentProcess(); - if (current_romfs.Failed()) { - // TODO (bunnei): Find the right error code to use here - LOG_CRITICAL(Service_FS, "no file system interface available!"); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultUnknown); - return; + if (!romfs) { + auto current_romfs = fsc.OpenRomFSCurrentProcess(); + if (current_romfs.Failed()) { + // TODO (bunnei): Find the right error code to use here + LOG_CRITICAL(Service_FS, "no file system interface available!"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultUnknown); + return; + } + + romfs = current_romfs.Unwrap(); } - auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); + auto storage = std::make_shared<IStorage>(system, romfs); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(ResultSuccess); |