summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authoritskarudo <itskarudo@protonmail.com>2022-02-12 09:43:49 +0100
committerTim Flynn <trflynn89@pm.me>2022-02-12 10:53:07 -0500
commit500098c76d62682d0d3b19774d62feba7f0a1d89 (patch)
tree51834caebc00573d2d72cd6ebb8d2b4752dcbbf5 /Userland/Utilities
parentc23d25d1dee4b34379282fe2aeb60bc6856aeb73 (diff)
downloadserenity-500098c76d62682d0d3b19774d62feba7f0a1d89.zip
kill: Port to LibMain
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/CMakeLists.txt1
-rw-r--r--Userland/Utilities/kill.cpp13
2 files changed, 9 insertions, 5 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt
index f762d7c23d..8840db0319 100644
--- a/Userland/Utilities/CMakeLists.txt
+++ b/Userland/Utilities/CMakeLists.txt
@@ -118,6 +118,7 @@ target_link_libraries(jp LibMain)
target_link_libraries(js LibJS LibLine LibMain)
link_with_unicode_data(js)
target_link_libraries(keymap LibKeyboard LibMain)
+target_link_libraries(kill LibMain)
target_link_libraries(less LibMain)
target_link_libraries(ln LibMain)
target_link_libraries(logout LibMain)
diff --git a/Userland/Utilities/kill.cpp b/Userland/Utilities/kill.cpp
index 01e4d22901..ab31f4b2b4 100644
--- a/Userland/Utilities/kill.cpp
+++ b/Userland/Utilities/kill.cpp
@@ -6,6 +6,8 @@
#include <AK/Optional.h>
#include <AK/String.h>
+#include <LibCore/System.h>
+#include <LibMain/Main.h>
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
@@ -19,12 +21,13 @@ static void print_usage_and_exit()
exit(1);
}
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- if (pledge("stdio proc", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+
+ TRY(Core::System::pledge("stdio proc"));
+
+ int argc = arguments.argc;
+ char** argv = arguments.argv;
if (argc == 2 && !strcmp(argv[1], "-l")) {
for (size_t i = 0; i < NSIG; ++i) {