mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 09:55:45 +00:00
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.
This commit is contained in:
parent
23c2fbfc7a
commit
0be5c03176
7 changed files with 57 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue