mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00
umount: Port to LibMain
This commit is contained in:
parent
2291ef6c3c
commit
e37af0b073
2 changed files with 7 additions and 9 deletions
|
@ -160,6 +160,7 @@ target_link_libraries(top LibMain)
|
||||||
target_link_libraries(touch LibMain)
|
target_link_libraries(touch LibMain)
|
||||||
target_link_libraries(truncate LibMain)
|
target_link_libraries(truncate LibMain)
|
||||||
target_link_libraries(tt LibPthread)
|
target_link_libraries(tt LibPthread)
|
||||||
|
target_link_libraries(umount LibMain)
|
||||||
target_link_libraries(uname LibMain)
|
target_link_libraries(uname LibMain)
|
||||||
target_link_libraries(uniq LibMain)
|
target_link_libraries(uniq LibMain)
|
||||||
target_link_libraries(unzip LibArchive LibCompress LibMain)
|
target_link_libraries(unzip LibArchive LibCompress LibMain)
|
||||||
|
|
|
@ -5,20 +5,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <stdio.h>
|
#include <LibCore/System.h>
|
||||||
#include <unistd.h>
|
#include <LibMain/Main.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
const char* mount_point = nullptr;
|
StringView mount_point;
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.add_positional_argument(mount_point, "Mount point", "mountpoint");
|
args_parser.add_positional_argument(mount_point, "Mount point", "mountpoint");
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
if (umount(mount_point) < 0) {
|
TRY(Core::System::umount(mount_point));
|
||||||
perror("umount");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue