2020-06-22 16:35:22 -03:00
|
|
|
/*
|
2021-11-23 06:39:52 -03:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-06-22 16:35:22 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-22 16:35:22 -03:00
|
|
|
*/
|
|
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
#include <ImageDecoder/ConnectionFromClient.h>
|
2020-06-22 16:35:22 -03:00
|
|
|
#include <LibCore/EventLoop.h>
|
2021-11-23 06:59:50 -03:00
|
|
|
#include <LibCore/System.h>
|
2021-12-06 14:11:05 -03:00
|
|
|
#include <LibIPC/SingleServer.h>
|
2021-11-23 06:39:52 -03:00
|
|
|
#include <LibMain/Main.h>
|
2020-06-22 16:35:22 -03:00
|
|
|
|
2021-11-23 06:39:52 -03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2020-06-22 16:35:22 -03:00
|
|
|
{
|
|
|
|
|
Core::EventLoop event_loop;
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio recvfd sendfd unix"));
|
2021-11-23 06:59:50 -03:00
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2020-06-22 16:35:22 -03:00
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
auto client = TRY(IPC::take_over_accepted_client_from_system_server<ImageDecoder::ConnectionFromClient>());
|
2021-12-06 14:11:05 -03:00
|
|
|
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio recvfd sendfd"));
|
2020-06-22 16:35:22 -03:00
|
|
|
return event_loop.exec();
|
|
|
|
|
}
|