diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2014-09-27 19:21:48 +0000 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2014-10-06 19:58:42 +0200 |
commit | 0be5c03176236fe602d49c32717a6f3af0a55465 (patch) | |
tree | 61573d4ed66ac5e7f46968ef871b3acf9f0c5b99 /src/core/file_sys/archive_sdmc.cpp | |
parent | 23c2fbfc7a900ae3c9f8791a87c5ad672f5778fe (diff) |
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.
Diffstat (limited to 'src/core/file_sys/archive_sdmc.cpp')
-rw-r--r-- | src/core/file_sys/archive_sdmc.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<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); } |