2020-06-22 21:35:22 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-22 21:35:22 +02:00
|
|
|
*/
|
|
|
|
|
|
2020-09-18 09:49:51 +02:00
|
|
|
#include <ImageDecoder/ClientConnection.h>
|
2020-06-22 21:35:22 +02:00
|
|
|
#include <LibCore/EventLoop.h>
|
|
|
|
|
#include <LibCore/LocalServer.h>
|
|
|
|
|
#include <LibIPC/ClientConnection.h>
|
|
|
|
|
|
|
|
|
|
int main(int, char**)
|
|
|
|
|
{
|
|
|
|
|
Core::EventLoop event_loop;
|
2021-01-17 08:18:11 +01:00
|
|
|
if (pledge("stdio recvfd sendfd unix", nullptr) < 0) {
|
2020-06-22 21:35:22 +02:00
|
|
|
perror("pledge");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if (unveil(nullptr, nullptr) < 0) {
|
|
|
|
|
perror("unveil");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
|
2020-07-06 13:23:39 +02:00
|
|
|
IPC::new_client_connection<ImageDecoder::ClientConnection>(socket.release_nonnull(), 1);
|
2021-01-17 08:18:11 +01:00
|
|
|
if (pledge("stdio recvfd sendfd", nullptr) < 0) {
|
2020-06-22 21:35:22 +02:00
|
|
|
perror("pledge");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return event_loop.exec();
|
|
|
|
|
}
|