IOS/FS: Make it harder to forget closing FDs

Return a FileHandle which will automatically close the FD when
the handle goes out of scope. For the rare cases where this behaviour
is undesirable, the FD can be released from the handle.
This commit is contained in:
Léo Lam 2018-03-08 18:32:49 +01:00
commit 2d8be6a77d
6 changed files with 59 additions and 9 deletions

View file

@ -49,7 +49,6 @@ static void CreateVirtualFATFilesystem(std::shared_ptr<IOS::HLE::FS::FileSystem>
// write the final 0 to 0 file from the second FAT to 20 MiB
data[CDB_SIZE - 1] = 0;
fs->WriteFile(*fd, data.data(), static_cast<u32>(data.size()));
fs->Close(*fd);
}
bool CBoot::BootNANDTitle(const u64 title_id)