mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:47:45 +00:00
LaunchServer: Port to LibMain :^)
This commit is contained in:
parent
58b99df16d
commit
69ea1ff743
2 changed files with 6 additions and 10 deletions
|
@ -16,4 +16,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_bin(LaunchServer)
|
serenity_bin(LaunchServer)
|
||||||
target_link_libraries(LaunchServer LibCore LibIPC LibDesktop)
|
target_link_libraries(LaunchServer LibCore LibIPC LibDesktop LibMain)
|
||||||
|
|
|
@ -9,23 +9,19 @@
|
||||||
#include <LibCore/ConfigFile.h>
|
#include <LibCore/ConfigFile.h>
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/LocalServer.h>
|
#include <LibCore/LocalServer.h>
|
||||||
#include <stdio.h>
|
#include <LibCore/System.h>
|
||||||
#include <unistd.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;
|
Core::EventLoop event_loop;
|
||||||
auto server = Core::LocalServer::construct();
|
auto server = TRY(Core::LocalServer::try_create());
|
||||||
|
|
||||||
auto launcher = LaunchServer::Launcher();
|
auto launcher = LaunchServer::Launcher();
|
||||||
|
|
||||||
launcher.load_handlers();
|
launcher.load_handlers();
|
||||||
launcher.load_config(Core::ConfigFile::open_for_app("LaunchServer"));
|
launcher.load_config(Core::ConfigFile::open_for_app("LaunchServer"));
|
||||||
|
|
||||||
if (pledge("stdio accept rpath proc exec", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio accept rpath proc exec"));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
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