From ab02c567250094fb5c88abeaabb967db7527ce6b Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 15 Oct 2019 14:19:34 +0300 Subject: [PATCH] sceNpTrophyRegisterContext verbose logging in TROPHY_ERROR_ILLEGAL_UPDATE error Also use safer checking when creating trophy ctxt dir --- rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp | 3 +++ rpcs3/Loader/TRP.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp index 9bea9b1f54..45c78cafad 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp @@ -340,6 +340,7 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, TRPLoader trp(ctxt->trp_stream); if (!trp.LoadHeader()) { + sceNpTrophy.error("sceNpTrophyRegisterContext(): Failed to load trophy config header"); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } @@ -362,6 +363,7 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, } else if (!trp.ContainsEntry("TROPCONF.SFM")) { + sceNpTrophy.error("sceNpTrophyRegisterContext(): Invalid/Incomplete trophy config"); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } @@ -378,6 +380,7 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; if (!trp.Install(trophyPath)) { + sceNpTrophy.error("sceNpTrophyRegisterContext(): Failed to install trophy context '%s' (%s)", trophyPath, fs::g_tls_error); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } diff --git a/rpcs3/Loader/TRP.cpp b/rpcs3/Loader/TRP.cpp index 50cf86c20d..f62ce536f0 100644 --- a/rpcs3/Loader/TRP.cpp +++ b/rpcs3/Loader/TRP.cpp @@ -18,7 +18,7 @@ bool TRPLoader::Install(const std::string& dest, bool show) const std::string& local_path = vfs::get(dest); - if (!fs::create_dir(local_path) && fs::g_tls_error != fs::error::exist) + if (!fs::is_dir(local_path) && !fs::create_dir(local_path)) { return false; }