ConfigServer: Port to LibMain :^)

This commit is contained in:
Andreas Kling 2021-11-23 15:25:17 +01:00
parent 9c9cd20dce
commit 70b1312fd4
Notes: sideshowbarker 2024-07-18 00:47:56 +09:00
2 changed files with 8 additions and 15 deletions

View file

@ -15,4 +15,4 @@ set(SOURCES
)
serenity_bin(ConfigServer)
target_link_libraries(ConfigServer LibIPC)
target_link_libraries(ConfigServer LibIPC LibMain)

View file

@ -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);