Various fixes. Note: This contains debug stuff which will be removed later. I was getting tired of having to cherrypick tiny changes

This commit is contained in:
Adubbz
2019-08-04 13:10:45 +10:00
parent b2dd198dc8
commit ef28b7d395
16 changed files with 639 additions and 174 deletions

View File

@@ -19,6 +19,7 @@
#include <stratosphere/kvdb/kvdb_memory_key_value_store.hpp>
#include <optional>
#include "../debug.hpp"
#include "../ncm_contentmetadatabase.hpp"
#include "../ncm_contentstorage.hpp"
#include "../ncm_fs.hpp"
@@ -62,7 +63,7 @@ namespace sts::ncm::impl {
u64 journal_size;
u32 flags;
FsSaveDataSpaceId space_id;
} PACKED;
};
static_assert(sizeof(SaveDataMeta) == 0x20, "SaveDataMeta definition!");
@@ -150,6 +151,9 @@ namespace sts::ncm::impl {
return ResultSuccess;
}
R_ASSERT(debug::Initialize());
debug::DebugLog("ContentManager::InitializeContentManager\n");
size_t cur_storage_index = g_num_content_storage_entries;
for (size_t i = 0; i < MaxContentStorageEntries; i++) {

View File

@@ -20,6 +20,8 @@
#include "../ncm_make_path.hpp"
#include "../ncm_path_utils.hpp"
#include "../debug.hpp"
namespace sts::ncm::impl {
unsigned int PlaceHolderAccessor::GetDirectoryDepth() {
@@ -78,6 +80,8 @@ 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;
@@ -97,6 +101,7 @@ namespace sts::ncm::impl {
FILE* f = fopen(placeholder_path, "r+b");
if (f == nullptr) {
debug::DebugLog("Failed to open placeholder %s\n", placeholder_path);
return fsdevGetLastResult();
}