Properly unmount the file
This commit is contained in:
parent
d27b8acfd9
commit
60999ec241
|
@ -231,10 +231,13 @@ static void romfs_mountclose(romfs_mount *mount) {
|
||||||
if (mount->fd_type == RomfsSource_FileDescriptor) {
|
if (mount->fd_type == RomfsSource_FileDescriptor) {
|
||||||
close(mount->fd);
|
close(mount->fd);
|
||||||
}
|
}
|
||||||
if (mount->fd_type == RomfsSource_FileDescriptor) {
|
if (mount->fd_type == RomfsSource_FileDescriptor_CafeOS) {
|
||||||
FSCmdBlock cmd;
|
FSCmdBlock cmd;
|
||||||
FSInitCmdBlock(&cmd);
|
FSInitCmdBlock(&cmd);
|
||||||
FSCloseFile(&mount->cafe_client, &cmd, mount->cafe_fd, FS_ERROR_FLAG_ALL);
|
FSCloseFile(&mount->cafe_client, &cmd, mount->cafe_fd, FS_ERROR_FLAG_ALL);
|
||||||
|
mount->cafe_fd = 0;
|
||||||
|
FSDelClient(&mount->cafe_client, 0);
|
||||||
|
memset(&mount->cafe_client, 0, sizeof(FSClient));
|
||||||
}
|
}
|
||||||
romfs_free(mount);
|
romfs_free(mount);
|
||||||
}
|
}
|
||||||
|
@ -356,10 +359,6 @@ int32_t romfsUnmount(const char *name) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mount->fd_type == RomfsSource_FileDescriptor_CafeOS) {
|
|
||||||
FSDelClient(&mount->cafe_client, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove device
|
// Remove device
|
||||||
memset(tmpname, 0, sizeof(tmpname));
|
memset(tmpname, 0, sizeof(tmpname));
|
||||||
strncpy(tmpname, mount->name, sizeof(tmpname) - 2);
|
strncpy(tmpname, mount->name, sizeof(tmpname) - 2);
|
||||||
|
|
Loading…
Reference in New Issue