From 9e9987a6737824e7eb75d269461eb6fbd2efd7ba Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 4 Aug 2019 22:33:15 +1000 Subject: [PATCH] Fixed placeholder/content deletion --- .../ncm/source/impl/ncm_placeholder_accessor.cpp | 14 +++++++------- stratosphere/ncm/source/ncm_contentstorage.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp b/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp index c3236a4c8..311fbc112 100644 --- a/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp +++ b/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp @@ -80,13 +80,13 @@ namespace sts::ncm::impl { this->GetPlaceHolderPathUncached(placeholder_path, placeholder_id); - debug::DebugLog("Deleting %s\n", placeholder_path); - - R_TRY_CATCH(fsdevDeleteDirectoryRecursively(placeholder_path)) { - R_CATCH(ResultFsPathNotFound) { - return ResultNcmPlaceHolderNotFound; - } - } R_END_TRY_CATCH; + if (std::remove(placeholder_path) != 0) { + R_TRY_CATCH(fsdevGetLastResult()) { + R_CATCH(ResultFsPathNotFound) { + return ResultNcmPlaceHolderNotFound; + } + } R_END_TRY_CATCH; + } return ResultSuccess; } diff --git a/stratosphere/ncm/source/ncm_contentstorage.cpp b/stratosphere/ncm/source/ncm_contentstorage.cpp index 9e1599599..0c8ad80c2 100644 --- a/stratosphere/ncm/source/ncm_contentstorage.cpp +++ b/stratosphere/ncm/source/ncm_contentstorage.cpp @@ -223,16 +223,16 @@ namespace sts::ncm { } this->ClearContentCache(); - char content_path[FS_MAX_PATH] = {0}; - this->GetContentPath(content_path, content_id); - R_TRY_CATCH(fsdevDeleteDirectoryRecursively(content_path)) { - R_CATCH(ResultFsPathNotFound) { - return ResultNcmContentNotFound; - } - } R_END_TRY_CATCH; + if (std::remove(content_path) != 0) { + R_TRY_CATCH(fsdevGetLastResult()) { + R_CATCH(ResultFsPathNotFound) { + return ResultNcmContentNotFound; + } + } R_END_TRY_CATCH; + } return ResultSuccess; R_DEBUG_END