ladybird/Userland/DevTools/HackStudio/LanguageServers/Cpp/main.cpp
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

36 lines
966 B
C++

/*
* Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include <AK/LexicalPath.h>
#include <LibCore/EventLoop.h>
#include <LibCore/File.h>
#include <LibCore/LocalServer.h>
#include <LibIPC/ClientConnection.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int, char**)
{
Core::EventLoop event_loop;
if (pledge("stdio unix recvfd rpath ", nullptr) < 0) {
perror("pledge");
return 1;
}
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
IPC::new_client_connection<LanguageServers::Cpp::ClientConnection>(socket.release_nonnull(), 1);
if (pledge("stdio recvfd rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/usr/include", "r") < 0)
perror("unveil");
// unveil will be sealed later, when we know the project's root path.
return event_loop.exec();
}