1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:04:59 +00:00
serenity/Userland/DevTools/HackStudio/LanguageServers/Shell/main.cpp
Sam Atkins d2024f04bd Userland: Cast unused BackgroundAction::construct() results to void
User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
2021-12-05 15:31:03 +01:00

25 lines
749 B
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
#include <LibCore/System.h>
#include <LibIPC/ClientConnection.h>
#include <LibMain/Main.h>
ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
TRY(Core::System::pledge("stdio unix rpath recvfd"));
auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
(void)IPC::new_client_connection<LanguageServers::Shell::ClientConnection>(move(socket), 1);
TRY(Core::System::pledge("stdio rpath recvfd"));
TRY(Core::System::unveil("/etc/passwd", "r"));
return event_loop.exec();
}