serenity/Userland/Services/LaunchServer/main.cpp

28 lines
738 B
C++
Raw Normal View History

/*
* Copyright (c) 2020, Nicholas Hollett <niax@niax.co.uk>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ConnectionFromClient.h"
#include "Launcher.h"
#include <LibCore/ConfigFile.h>
#include <LibCore/EventLoop.h>
2021-12-06 15:57:25 +01:00
#include <LibCore/System.h>
#include <LibIPC/MultiServer.h>
2021-12-06 15:57:25 +01:00
#include <LibMain/Main.h>
2021-12-06 15:57:25 +01:00
ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
auto server = TRY(IPC::MultiServer<LaunchServer::ConnectionFromClient>::try_create());
auto launcher = LaunchServer::Launcher();
2020-12-27 18:55:01 +01:00
launcher.load_handlers();
launcher.load_config(TRY(Core::ConfigFile::open_for_app("LaunchServer")));
2021-12-06 15:57:25 +01:00
TRY(Core::System::pledge("stdio accept rpath proc exec"));
return event_loop.exec();
}