mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 18:42:15 +02:00
Add fsdevDeleteDevice
This way one can unmount filesystems without closing them (in case they would be used later without fsdev/stdio)
This commit is contained in:
parent
5090c54654
commit
bf0df0c369
@ -335,7 +335,6 @@ static int _fsdevUnmountDeviceStruct(fsdev_fsdevice *device)
|
|||||||
strncat(name, ":", sizeof(name)-strlen(name)-1);
|
strncat(name, ":", sizeof(name)-strlen(name)-1);
|
||||||
|
|
||||||
RemoveDevice(name);
|
RemoveDevice(name);
|
||||||
fsFsClose(&device->fs);
|
|
||||||
|
|
||||||
if(device->id == fsdev_fsdevice_default)
|
if(device->id == fsdev_fsdevice_default)
|
||||||
fsdev_fsdevice_default = -1;
|
fsdev_fsdevice_default = -1;
|
||||||
@ -349,7 +348,7 @@ static int _fsdevUnmountDeviceStruct(fsdev_fsdevice *device)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fsdevUnmountDevice(const char *name)
|
int fsdevDeleteDevice(const char *name)
|
||||||
{
|
{
|
||||||
fsdev_fsdevice *device;
|
fsdev_fsdevice *device;
|
||||||
|
|
||||||
@ -360,6 +359,21 @@ int fsdevUnmountDevice(const char *name)
|
|||||||
return _fsdevUnmountDeviceStruct(device);
|
return _fsdevUnmountDeviceStruct(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int fsdevUnmountDevice(const char *name)
|
||||||
|
{
|
||||||
|
fsdev_fsdevice *device;
|
||||||
|
|
||||||
|
device = fsdevFindDevice(name);
|
||||||
|
if(device==NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
int ret = _fsdevUnmountDeviceStruct(device);
|
||||||
|
if(ret==0)
|
||||||
|
fsFsClose(&device->fs);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
Result fsdevCommitDevice(const char *name)
|
Result fsdevCommitDevice(const char *name)
|
||||||
{
|
{
|
||||||
fsdev_fsdevice *device;
|
fsdev_fsdevice *device;
|
||||||
|
Loading…
Reference in New Issue
Block a user