summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-23 15:25:17 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-23 15:44:59 +0100
commit70b1312fd4056e6edc93187fe5e3e4dc6c5163a7 (patch)
tree6f6e0f0014652452f87b9eac00f610a2d5fd34b1 /Userland/Services
parent9c9cd20dceb6e69e18827a3a78c643ea6990d5e8 (diff)
downloadserenity-70b1312fd4056e6edc93187fe5e3e4dc6c5163a7.zip
ConfigServer: Port to LibMain :^)
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/ConfigServer/CMakeLists.txt2
-rw-r--r--Userland/Services/ConfigServer/main.cpp21
2 files changed, 8 insertions, 15 deletions
diff --git a/Userland/Services/ConfigServer/CMakeLists.txt b/Userland/Services/ConfigServer/CMakeLists.txt
index febcc964ac..2cde832a98 100644
--- a/Userland/Services/ConfigServer/CMakeLists.txt
+++ b/Userland/Services/ConfigServer/CMakeLists.txt
@@ -15,4 +15,4 @@ set(SOURCES
)
serenity_bin(ConfigServer)
-target_link_libraries(ConfigServer LibIPC)
+target_link_libraries(ConfigServer LibIPC LibMain)
diff --git a/Userland/Services/ConfigServer/main.cpp b/Userland/Services/ConfigServer/main.cpp
index 6bf07cd020..cde5a16075 100644
--- a/Userland/Services/ConfigServer/main.cpp
+++ b/Userland/Services/ConfigServer/main.cpp
@@ -7,24 +7,17 @@
#include "ClientConnection.h"
#include <LibCore/LocalServer.h>
#include <LibCore/StandardPaths.h>
-#include <unistd.h>
+#include <LibCore/System.h>
+#include <LibMain/Main.h>
-int main(int, char**)
+ErrorOr<int> serenity_main(Main::Arguments)
{
- if (pledge("stdio accept rpath wpath cpath", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
-
- if (unveil(Core::StandardPaths::config_directory().characters(), "rwc") < 0) {
- perror("unveil");
- return 1;
- }
-
- unveil(nullptr, nullptr);
+ TRY(Core::System::pledge("stdio accept rpath wpath cpath", nullptr));
+ TRY(Core::System::unveil(Core::StandardPaths::config_directory(), "rwc"));
+ TRY(Core::System::unveil(nullptr, nullptr));
Core::EventLoop event_loop;
- auto server = Core::LocalServer::construct();
+ auto server = TRY(Core::LocalServer::try_create());
bool ok = server->take_over_from_system_server();
VERIFY(ok);