mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
[FS] Better DeleteFile, fclose when file session is closed
This commit is contained in:
parent
9ec2964695
commit
01d16fdfd1
3 changed files with 51 additions and 4 deletions
|
@ -41,7 +41,12 @@ void Kernel::closeFile(u32 messagePointer, Handle fileHandle) {
|
|||
Helpers::panic("Called CloseFile on non-existent file");
|
||||
}
|
||||
|
||||
p->getData<FileSession>()->isOpen = false;
|
||||
FileSession* session = p->getData<FileSession>();
|
||||
session->isOpen = false;
|
||||
if (session->fd != nullptr) {
|
||||
fclose(session->fd);
|
||||
}
|
||||
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue