From 6e2f7a15fb5c4bcb71630f0121e258f645bb63bb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 29 Nov 2021 19:34:04 +0100 Subject: [PATCH] InspectorServer: Port to LibMain :^) --- Userland/Services/InspectorServer/CMakeLists.txt | 2 +- Userland/Services/InspectorServer/main.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Userland/Services/InspectorServer/CMakeLists.txt b/Userland/Services/InspectorServer/CMakeLists.txt index d5ec047757..c3a87b266b 100644 --- a/Userland/Services/InspectorServer/CMakeLists.txt +++ b/Userland/Services/InspectorServer/CMakeLists.txt @@ -16,4 +16,4 @@ set(SOURCES ) serenity_bin(InspectorServer) -target_link_libraries(InspectorServer LibIPC) +target_link_libraries(InspectorServer LibIPC LibMain) diff --git a/Userland/Services/InspectorServer/main.cpp b/Userland/Services/InspectorServer/main.cpp index fec999ae7d..9ed33c1b03 100644 --- a/Userland/Services/InspectorServer/main.cpp +++ b/Userland/Services/InspectorServer/main.cpp @@ -8,17 +8,16 @@ #include #include #include +#include #include +#include -int main(int, char**) +ErrorOr serenity_main(Main::Arguments) { Core::EventLoop event_loop; - auto server = Core::LocalServer::construct(); + auto server = TRY(Core::LocalServer::try_create()); - if (pledge("stdio unix accept", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio unix accept")); bool ok = server->take_over_from_system_server("/tmp/portal/inspector"); VERIFY(ok); @@ -28,7 +27,7 @@ int main(int, char**) IPC::new_client_connection(move(client_socket), client_id); }; - auto inspectables_server = Core::LocalServer::construct(); + auto inspectables_server = TRY(Core::LocalServer::try_create()); if (!inspectables_server->take_over_from_system_server("/tmp/portal/inspectables")) VERIFY_NOT_REACHED();