summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);