mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
ConfigServer: Port to LibMain :^)
This commit is contained in:
parent
9c9cd20dce
commit
70b1312fd4
2 changed files with 8 additions and 15 deletions
|
@ -15,4 +15,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_bin(ConfigServer)
|
serenity_bin(ConfigServer)
|
||||||
target_link_libraries(ConfigServer LibIPC)
|
target_link_libraries(ConfigServer LibIPC LibMain)
|
||||||
|
|
|
@ -7,24 +7,17 @@
|
||||||
#include "ClientConnection.h"
|
#include "ClientConnection.h"
|
||||||
#include <LibCore/LocalServer.h>
|
#include <LibCore/LocalServer.h>
|
||||||
#include <LibCore/StandardPaths.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) {
|
TRY(Core::System::pledge("stdio accept rpath wpath cpath", nullptr));
|
||||||
perror("pledge");
|
TRY(Core::System::unveil(Core::StandardPaths::config_directory(), "rwc"));
|
||||||
return 1;
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
}
|
|
||||||
|
|
||||||
if (unveil(Core::StandardPaths::config_directory().characters(), "rwc") < 0) {
|
|
||||||
perror("unveil");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
unveil(nullptr, nullptr);
|
|
||||||
|
|
||||||
Core::EventLoop event_loop;
|
Core::EventLoop event_loop;
|
||||||
auto server = Core::LocalServer::construct();
|
auto server = TRY(Core::LocalServer::try_create());
|
||||||
|
|
||||||
bool ok = server->take_over_from_system_server();
|
bool ok = server->take_over_from_system_server();
|
||||||
VERIFY(ok);
|
VERIFY(ok);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue