summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-29 19:34:04 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-30 23:34:40 +0100
commit6e2f7a15fb5c4bcb71630f0121e258f645bb63bb (patch)
treee1501b7398211ab1a6658cf3e551e1c3405bf468 /Userland/Services
parentfe003939413d0de648618e2cd5f5c72182c7cf7b (diff)
downloadserenity-6e2f7a15fb5c4bcb71630f0121e258f645bb63bb.zip
InspectorServer: Port to LibMain :^)
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/InspectorServer/CMakeLists.txt2
-rw-r--r--Userland/Services/InspectorServer/main.cpp13
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 <InspectorServer/ClientConnection.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)
{
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<InspectorServer::ClientConnection>(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();