From b03332d09b127e51d027c23ddebb8dc745cae9ad Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Fri, 28 Sep 2018 17:08:39 -0400 Subject: [PATCH] fs: remove ArchiveFactory_ExtSaveData::Initialize This is unnecessary as any open archive would create the full path for themselves --- src/core/file_sys/archive_extsavedata.cpp | 9 --------- src/core/file_sys/archive_extsavedata.h | 6 ------ src/core/hle/service/fs/archive.cpp | 12 ++---------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index e8da21193e..c645264160 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -194,15 +194,6 @@ ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_ LOG_DEBUG(Service_FS, "Directory {} set as base for ExtSaveData.", mount_point); } -bool ArchiveFactory_ExtSaveData::Initialize() { - if (!FileUtil::CreateFullPath(mount_point)) { - LOG_ERROR(Service_FS, "Unable to create ExtSaveData base path."); - return false; - } - - return true; -} - Path ArchiveFactory_ExtSaveData::GetCorrectedPath(const Path& path) { if (!shared) return path; diff --git a/src/core/file_sys/archive_extsavedata.h b/src/core/file_sys/archive_extsavedata.h index 79d266df40..151b367b54 100644 --- a/src/core/file_sys/archive_extsavedata.h +++ b/src/core/file_sys/archive_extsavedata.h @@ -20,12 +20,6 @@ class ArchiveFactory_ExtSaveData final : public ArchiveFactory { public: ArchiveFactory_ExtSaveData(const std::string& mount_point, bool shared); - /** - * Initialize the archive. - * @return true if it initialized successfully - */ - bool Initialize(); - std::string GetName() const override { return "ExtSaveData"; } diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 752e0ffefc..d54a7b866a 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -646,19 +646,11 @@ void RegisterArchiveTypes() { auto extsavedata_factory = std::make_unique(sdmc_directory, false); - if (extsavedata_factory->Initialize()) - RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); - else - LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}", - extsavedata_factory->GetMountPoint()); + RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); auto sharedextsavedata_factory = std::make_unique(nand_directory, true); - if (sharedextsavedata_factory->Initialize()) - RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); - else - LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}", - sharedextsavedata_factory->GetMountPoint()); + RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); // Create the NCCH archive, basically a small variation of the RomFS archive auto savedatacheck_factory = std::make_unique();