mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
umount: Port to LibMain
This commit is contained in:
parent
2291ef6c3c
commit
e37af0b073
Notes:
sideshowbarker
2024-07-17 20:27:18 +09:00
Author: https://github.com/guerinoni Commit: https://github.com/SerenityOS/serenity/commit/e37af0b073f Pull-request: https://github.com/SerenityOS/serenity/pull/12012 Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/Rummskartoffel ✅
@ -160,6 +160,7 @@ target_link_libraries(top LibMain)
|
||||
target_link_libraries(touch LibMain)
|
||||
target_link_libraries(truncate LibMain)
|
||||
target_link_libraries(tt LibPthread)
|
||||
target_link_libraries(umount LibMain)
|
||||
target_link_libraries(uname LibMain)
|
||||
target_link_libraries(uniq LibMain)
|
||||
target_link_libraries(unzip LibArchive LibCompress LibMain)
|
||||
|
@ -5,20 +5,17 @@
|
||||
*/
|
||||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <LibCore/System.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;
|
||||
args_parser.add_positional_argument(mount_point, "Mount point", "mountpoint");
|
||||
args_parser.parse(argc, argv);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
if (umount(mount_point) < 0) {
|
||||
perror("umount");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::umount(mount_point));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user