diff options
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/clear.cpp | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 754320fbf7..ded9fda0e7 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -68,6 +68,7 @@ target_link_libraries(chgrp LibMain) target_link_libraries(chown LibMain) target_link_libraries(chres LibGUI LibMain) target_link_libraries(cksum LibCrypto LibMain) +target_link_libraries(clear LibMain) target_link_libraries(config LibConfig) target_link_libraries(copy LibGUI LibMain) target_link_libraries(cp LibMain) diff --git a/Userland/Utilities/clear.cpp b/Userland/Utilities/clear.cpp index 377acffb6d..e8fc9fea72 100644 --- a/Userland/Utilities/clear.cpp +++ b/Userland/Utilities/clear.cpp @@ -4,15 +4,13 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <LibCore/System.h> +#include <LibMain/Main.h> #include <stdio.h> -#include <unistd.h> -int main(int, char**) +ErrorOr<int> serenity_main(Main::Arguments) { - if (pledge("stdio", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio", nullptr)); printf("\033[3J\033[H\033[2J"); fflush(stdout); return 0; |