mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
bc22456f89
It is now possible to unmount file systems from the VFS via `umount`. It works via looking up the `fsid` of the filesystem from the `Inode`'s metatdata so I'm not sure how fragile it is. It seems to work for now though as something to get us going.
23 lines
468 B
C++
23 lines
468 B
C++
#include <LibCore/CArgsParser.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
CArgsParser args_parser("umount");
|
|
args_parser.add_arg("mountpoint", "mount point");
|
|
CArgsParserResult args = args_parser.parse(argc, argv);
|
|
|
|
if (argc == 2) {
|
|
if (umount(argv[1]) < 0) {
|
|
perror("umount");
|
|
return 1;
|
|
}
|
|
} else {
|
|
args_parser.print_usage();
|
|
return 0;
|
|
}
|
|
|
|
return 0;
|
|
}
|