From d34673990b5176c7ab71c239694737a9ac8df14e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 27 Sep 2014 19:09:04 +0000 Subject: FileSys: Add forgotten docstrings. --- src/core/file_sys/archive_sdmc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/file_sys/archive_sdmc.cpp') diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 30d33be5f..8d0827380 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()); -- cgit v1.2.3 From 0be5c03176236fe602d49c32717a6f3af0a55465 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 27 Sep 2014 19:21:48 +0000 Subject: FileSys: split the constructor into an Open method, in order to notify the opener something went wrong. Kernel: Return an invalid handle to OpenFile when it failed to open. --- src/core/file_sys/archive_sdmc.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/file_sys/archive_sdmc.cpp') diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 8d0827380..213923c02 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -46,6 +46,8 @@ bool Archive_SDMC::Initialize() { std::unique_ptr 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); } -- cgit v1.2.3