mirror of
https://github.com/wiiu-env/libromfs_wiiu.git
synced 2025-02-17 02:16:19 +01:00
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) {
|
||||
close(mount->fd);
|
||||
}
|
||||
if (mount->fd_type == RomfsSource_FileDescriptor) {
|
||||
if (mount->fd_type == RomfsSource_FileDescriptor_CafeOS) {
|
||||
FSCmdBlock cmd;
|
||||
FSInitCmdBlock(&cmd);
|
||||
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);
|
||||
}
|
||||
@ -356,10 +359,6 @@ int32_t romfsUnmount(const char *name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mount->fd_type == RomfsSource_FileDescriptor_CafeOS) {
|
||||
FSDelClient(&mount->cafe_client, 0);
|
||||
}
|
||||
|
||||
// Remove device
|
||||
memset(tmpname, 0, sizeof(tmpname));
|
||||
strncpy(tmpname, mount->name, sizeof(tmpname) - 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user