diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-23 16:13:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-24 00:25:22 +0100 |
commit | 788be69bcdbc7e77f6dc693cbd9e6d910c8fa9ef (patch) | |
tree | b5b97ffca7b5b1af28f63a4cc4e23c3f6beacada /Userland/Services/Clipboard | |
parent | db79f1cb784eb064020b0a1a57b2bc021f345f75 (diff) | |
download | serenity-788be69bcdbc7e77f6dc693cbd9e6d910c8fa9ef.zip |
Clipboard: Port to LibMain :^)
Diffstat (limited to 'Userland/Services/Clipboard')
-rw-r--r-- | Userland/Services/Clipboard/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/Services/Clipboard/main.cpp | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/Userland/Services/Clipboard/CMakeLists.txt b/Userland/Services/Clipboard/CMakeLists.txt index 499c514ab3..05b31334ab 100644 --- a/Userland/Services/Clipboard/CMakeLists.txt +++ b/Userland/Services/Clipboard/CMakeLists.txt @@ -16,4 +16,4 @@ set(SOURCES ) serenity_bin(Clipboard) -target_link_libraries(Clipboard LibCore LibIPC) +target_link_libraries(Clipboard LibCore LibIPC LibMain) diff --git a/Userland/Services/Clipboard/main.cpp b/Userland/Services/Clipboard/main.cpp index 2b56915182..217a989585 100644 --- a/Userland/Services/Clipboard/main.cpp +++ b/Userland/Services/Clipboard/main.cpp @@ -8,21 +8,17 @@ #include <Clipboard/Storage.h> #include <LibCore/EventLoop.h> #include <LibCore/LocalServer.h> +#include <LibCore/System.h> #include <LibIPC/ClientConnection.h> +#include <LibMain/Main.h> -int main(int, char**) +ErrorOr<int> serenity_main(Main::Arguments) { - if (pledge("stdio recvfd sendfd accept", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio recvfd sendfd accept", nullptr)); Core::EventLoop event_loop; - if (unveil(nullptr, nullptr) < 0) { - perror("unveil"); - return 1; - } + TRY(Core::System::unveil(nullptr, nullptr)); - auto server = Core::LocalServer::construct(); + auto server = TRY(Core::LocalServer::try_create()); bool ok = server->take_over_from_system_server(); VERIFY(ok); |