diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-12 05:21:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-12 05:21:52 +0200 |
commit | 7230ceb58405ae8e7d16c933a473e8efdd52de93 (patch) | |
tree | d78587e365bd6741ea9b528a1ca3376824e84cc4 /src | |
parent | Merge pull request #585 from janisozaur/patch-11 (diff) | |
parent | Services/FS: Return the correct error code when trying to mount a nonexistent savedata. (diff) | |
download | yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar.gz yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar.bz2 yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar.lz yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar.xz yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.tar.zst yuzu-7230ceb58405ae8e7d16c933a473e8efdd52de93.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/file_sys/errors.h | 1 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/core/file_sys/errors.h b/src/core/file_sys/errors.h index 0ed7d2a0c..d3e9a3829 100644 --- a/src/core/file_sys/errors.h +++ b/src/core/file_sys/errors.h @@ -11,6 +11,7 @@ namespace FileSys { namespace ErrCodes { enum { NotFound = 1, + SaveDataNotFound = 1002, }; } diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 216bfea0a..82efe7f7d 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -7,6 +7,7 @@ #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/directory.h" +#include "core/file_sys/errors.h" #include "core/file_sys/filesystem.h" #include "core/file_sys/storage.h" #include "core/hle/ipc_helpers.h" @@ -531,12 +532,20 @@ void FSP_SRV::CreateSaveData(Kernel::HLERequestContext& ctx) { void FSP_SRV::MountSaveData(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_FS, "(STUBBED) called"); + // TODO(Subv): Read the input parameters and mount the requested savedata instead of always + // mounting the current process' savedata. FileSys::Path unused; - auto filesystem = OpenFileSystem(Type::SaveData, unused).Unwrap(); + auto filesystem = OpenFileSystem(Type::SaveData, unused); + + if (filesystem.Failed()) { + IPC::ResponseBuilder rb{ctx, 2, 0, 0}; + rb.Push(ResultCode(ErrorModule::FS, FileSys::ErrCodes::SaveDataNotFound)); + return; + } IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); + rb.PushIpcInterface<IFileSystem>(std::move(filesystem.Unwrap())); } void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |