summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-12-06 15:57:25 +0100
committerAndreas Kling <kling@serenityos.org>2021-12-06 19:22:16 +0100
commit69ea1ff7439c06639e92547d2ce4f19698f1efd1 (patch)
treeadd1c11d488b0ce9005c46e4ffc031f6707a6b06
parent58b99df16dda1c5b4f81a30239f3bb5bb04ded6b (diff)
downloadserenity-69ea1ff7439c06639e92547d2ce4f19698f1efd1.zip
LaunchServer: Port to LibMain :^)
-rw-r--r--Userland/Services/LaunchServer/CMakeLists.txt2
-rw-r--r--Userland/Services/LaunchServer/main.cpp14
2 files changed, 6 insertions, 10 deletions
diff --git a/Userland/Services/LaunchServer/CMakeLists.txt b/Userland/Services/LaunchServer/CMakeLists.txt
index 137b3285b0..02c05dfaa4 100644
--- a/Userland/Services/LaunchServer/CMakeLists.txt
+++ b/Userland/Services/LaunchServer/CMakeLists.txt
@@ -16,4 +16,4 @@ set(SOURCES
)
serenity_bin(LaunchServer)
-target_link_libraries(LaunchServer LibCore LibIPC LibDesktop)
+target_link_libraries(LaunchServer LibCore LibIPC LibDesktop LibMain)
diff --git a/Userland/Services/LaunchServer/main.cpp b/Userland/Services/LaunchServer/main.cpp
index 23afe66cf5..3b0d23bfc9 100644
--- a/Userland/Services/LaunchServer/main.cpp
+++ b/Userland/Services/LaunchServer/main.cpp
@@ -9,23 +9,19 @@
#include <LibCore/ConfigFile.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
-#include <stdio.h>
-#include <unistd.h>
+#include <LibCore/System.h>
+#include <LibMain/Main.h>
-int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
+ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
- auto server = Core::LocalServer::construct();
+ auto server = TRY(Core::LocalServer::try_create());
auto launcher = LaunchServer::Launcher();
-
launcher.load_handlers();
launcher.load_config(Core::ConfigFile::open_for_app("LaunchServer"));
- if (pledge("stdio accept rpath proc exec", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio accept rpath proc exec"));
bool ok = server->take_over_from_system_server();
VERIFY(ok);