summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/archive_sdmc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys/archive_sdmc.cpp')
-rw-r--r--src/core/file_sys/archive_sdmc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 30d33be5f..213923c02 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -24,6 +24,10 @@ Archive_SDMC::Archive_SDMC(const std::string& mount_point) {
Archive_SDMC::~Archive_SDMC() {
}
+/**
+ * Initialize the archive.
+ * @return true if it initialized successfully
+ */
bool Archive_SDMC::Initialize() {
if (!FileUtil::IsDirectory(mount_point)) {
WARN_LOG(FILESYS, "Directory %s not found, disabling SDMC.", mount_point.c_str());
@@ -42,6 +46,8 @@ bool Archive_SDMC::Initialize() {
std::unique_ptr<File> Archive_SDMC::OpenFile(const std::string& path, const Mode mode) const {
DEBUG_LOG(FILESYS, "called path=%s mode=%d", path.c_str(), mode);
File_SDMC* file = new File_SDMC(this, path, mode);
+ if (!file->Open())
+ return nullptr;
return std::unique_ptr<File>(file);
}