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 8d082738..213923c0 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