Fix breaking NAND when unmounting NitroFS (#144)

This commit is contained in:
Pk11 2022-01-06 02:48:47 -06:00 committed by GitHub
parent 26661dc6b3
commit 21c8ad9e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -413,7 +413,6 @@ void nitroUnmount(void) {
imgUnmount(); imgUnmount();
ownNitroFSMounted = 2; ownNitroFSMounted = 2;
fatUnmount("nitro");
nitroMounted = false; nitroMounted = false;
} }

View File

@ -68,7 +68,7 @@ u32 fntOffset; //offset to start of filename table
u32 fatOffset; //offset to start of file alloc table u32 fatOffset; //offset to start of file alloc table
bool hasLoader; //single global nds filehandle (is null if not in dldi/fat mode) bool hasLoader; //single global nds filehandle (is null if not in dldi/fat mode)
u16 chdirpathid; //default dir path id... u16 chdirpathid; //default dir path id...
FILE *ndsFile; FILE *ndsFile = NULL;
off_t ndsFileLastpos; //Used to determine need to fseek or not off_t ndsFileLastpos; //Used to determine need to fseek or not
devoptab_t nitroFSdevoptab = { devoptab_t nitroFSdevoptab = {
@ -136,7 +136,10 @@ nitroFSInit(const char *ndsfile)
char romstr[0x10]; char romstr[0x10];
chdirpathid = NITROROOT; chdirpathid = NITROROOT;
ndsFileLastpos = 0; ndsFileLastpos = 0;
ndsFile = NULL; if(ndsFile != NULL) {
fclose(ndsFile);
ndsFile = NULL;
}
if (ndsfile != NULL) if (ndsfile != NULL)
{ {
if ((ndsFile = fopen(ndsfile, "rb"))) if ((ndsFile = fopen(ndsfile, "rb")))