2020-04-26 16:27:57 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Nicholas Hollett <niax@niax.co.uk>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-26 16:27:57 -03:00
|
|
|
*/
|
|
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
#include "ConnectionFromClient.h"
|
2020-04-26 16:27:57 -03:00
|
|
|
#include "Launcher.h"
|
|
|
|
|
#include <LibCore/ConfigFile.h>
|
|
|
|
|
#include <LibCore/EventLoop.h>
|
2021-12-06 11:57:25 -03:00
|
|
|
#include <LibCore/System.h>
|
2021-12-06 13:54:11 -03:00
|
|
|
#include <LibIPC/MultiServer.h>
|
2021-12-06 11:57:25 -03:00
|
|
|
#include <LibMain/Main.h>
|
2020-04-26 16:27:57 -03:00
|
|
|
|
2021-12-06 11:57:25 -03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2020-04-26 16:27:57 -03:00
|
|
|
{
|
|
|
|
|
Core::EventLoop event_loop;
|
2022-02-25 07:18:30 -03:00
|
|
|
auto server = TRY(IPC::MultiServer<LaunchServer::ConnectionFromClient>::try_create());
|
2020-04-26 16:27:57 -03:00
|
|
|
|
|
|
|
|
auto launcher = LaunchServer::Launcher();
|
2020-12-27 14:55:01 -03:00
|
|
|
launcher.load_handlers();
|
2022-02-06 10:33:42 -03:00
|
|
|
launcher.load_config(TRY(Core::ConfigFile::open_for_app("LaunchServer")));
|
2020-04-26 16:27:57 -03:00
|
|
|
|
2021-12-06 11:57:25 -03:00
|
|
|
TRY(Core::System::pledge("stdio accept rpath proc exec"));
|
2020-04-26 16:27:57 -03:00
|
|
|
|
|
|
|
|
return event_loop.exec();
|
|
|
|
|
}
|