summaryrefslogtreecommitdiff
path: root/Userland/Services/ConfigServer/main.cpp
blob: da08477e1c5e7170ecca261d0d2baad5b0223423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include "ConnectionFromClient.h"
#include <LibCore/StandardPaths.h>
#include <LibCore/System.h>
#include <LibIPC/MultiServer.h>
#include <LibMain/Main.h>

ErrorOr<int> serenity_main(Main::Arguments)
{
    TRY(Core::System::pledge("stdio accept rpath wpath cpath"));
    TRY(Core::System::unveil(Core::StandardPaths::config_directory(), "rwc"));
    TRY(Core::System::unveil(nullptr, nullptr));

    Core::EventLoop event_loop;

    auto server = TRY(IPC::MultiServer<ConfigServer::ConnectionFromClient>::try_create());
    return event_loop.exec();
}