summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorMichel Hermier <michel.hermier@gmail.com>2022-01-20 21:13:12 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-01-24 05:38:30 +0000
commit395d9a27026d790c94779c2fe44f2554300750f0 (patch)
treeb7edc59a4fc0cf7ccabf6250185068a65af87f86 /Userland/Utilities
parent176de579f25d62d0ed5dfeb1654fb95a6881c313 (diff)
downloadserenity-395d9a27026d790c94779c2fe44f2554300750f0.zip
sort: Port to LibMain
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/CMakeLists.txt1
-rw-r--r--Userland/Utilities/sort.cpp9
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt
index 88deb87d94..846f2c2f64 100644
--- a/Userland/Utilities/CMakeLists.txt
+++ b/Userland/Utilities/CMakeLists.txt
@@ -149,6 +149,7 @@ target_link_libraries(run-tests LibRegex)
target_link_libraries(shot LibGUI)
target_link_libraries(shuf LibMain)
target_link_libraries(sql LibLine LibSQL LibIPC)
+target_link_libraries(sort LibMain)
target_link_libraries(stat LibMain)
target_link_libraries(strace LibMain)
target_link_libraries(tac LibMain)
diff --git a/Userland/Utilities/sort.cpp b/Userland/Utilities/sort.cpp
index 505da349c4..f499ff2d4c 100644
--- a/Userland/Utilities/sort.cpp
+++ b/Userland/Utilities/sort.cpp
@@ -7,18 +7,17 @@
#include <AK/QuickSort.h>
#include <AK/String.h>
#include <AK/Vector.h>
+#include <LibCore/System.h>
+#include <LibMain/Main.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
+ErrorOr<int> serenity_main([[maybe_unused]] Main::Arguments arguments)
{
- if (pledge("stdio", nullptr) > 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio"sv));
Vector<String> lines;