mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
ConfigServer: Port to LibMain :^)
This commit is contained in:
parent
9c9cd20dce
commit
70b1312fd4
Notes:
sideshowbarker
2024-07-18 00:47:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/70b1312fd40
2 changed files with 8 additions and 15 deletions
|
@ -15,4 +15,4 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_bin(ConfigServer)
|
||||
target_link_libraries(ConfigServer LibIPC)
|
||||
target_link_libraries(ConfigServer LibIPC LibMain)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue