fs Add unmount subcommand
This commit is contained in:
20
user/fs/unmount.c
Normal file
20
user/fs/unmount.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
void fs_unmount(void) {
|
||||
if (argslen() < 2) {
|
||||
uprintf("fs: Not enough arguments\n");
|
||||
return;
|
||||
}
|
||||
|
||||
char *mountpoint = *(args()+1);
|
||||
|
||||
int32_t ret = vfsunmount(mountpoint);
|
||||
|
||||
if (ret != E_OK) {
|
||||
uprintf("fs: Could not unmount %s\n", mountpoint);
|
||||
} else {
|
||||
uprintf("OK %s\n", mountpoint);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user