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