diff options
author | Michel Hermier <michel.hermier@gmail.com> | 2022-01-20 21:12:35 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-24 05:38:30 +0000 |
commit | 176de579f25d62d0ed5dfeb1654fb95a6881c313 (patch) | |
tree | 9ee41c4041d4697fc4ba66f905b28ee3665a095f /Userland/Utilities | |
parent | 4e02b204efc5e63ca109ee59125febfbd173e6b2 (diff) | |
download | serenity-176de579f25d62d0ed5dfeb1654fb95a6881c313.zip |
shuf: Port to LibMain
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/shuf.cpp | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 0da531fca6..88deb87d94 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -147,6 +147,7 @@ target_link_libraries(pwd LibMain) target_link_libraries(rev LibMain) 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(stat LibMain) target_link_libraries(strace LibMain) diff --git a/Userland/Utilities/shuf.cpp b/Userland/Utilities/shuf.cpp index d1a216c5ca..7df5a1ecfa 100644 --- a/Userland/Utilities/shuf.cpp +++ b/Userland/Utilities/shuf.cpp @@ -7,17 +7,16 @@ #include <AK/Random.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 <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; |