diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/CMakeLists.txt b/Userland/DevTools/HackStudio/LanguageServers/Shell/CMakeLists.txt index 59563e9a40d..246f7e42d4e 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Shell/CMakeLists.txt +++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/CMakeLists.txt @@ -16,4 +16,4 @@ serenity_bin(ShellLanguageServer) # We link with LibGUI because we use GUI::TextDocument to update # the content of files according to the edit actions we receive over IPC. -target_link_libraries(ShellLanguageServer LibIPC LibShell LibGUI LibLanguageServer) +target_link_libraries(ShellLanguageServer LibIPC LibShell LibGUI LibLanguageServer LibMain) diff --git a/Userland/DevTools/HackStudio/LanguageServers/Shell/main.cpp b/Userland/DevTools/HackStudio/LanguageServers/Shell/main.cpp index 5d47c1e6401..be46401579d 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Shell/main.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/Shell/main.cpp @@ -5,32 +5,21 @@ */ #include "ClientConnection.h" -#include #include -#include #include #include -#include -#include +#include +#include -int main(int, char**) +ErrorOr serenity_main(Main::Arguments) { Core::EventLoop event_loop; - if (pledge("stdio unix rpath recvfd", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(System::pledge("stdio unix rpath recvfd", nullptr)); auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server(); IPC::new_client_connection(socket.release_nonnull(), 1); - if (pledge("stdio rpath recvfd", nullptr) < 0) { - perror("pledge"); - return 1; - } - if (unveil("/etc/passwd", "r") < 0) { - perror("unveil"); - return 1; - } + TRY(System::pledge("stdio rpath recvfd", nullptr)); + TRY(System::unveil("/etc/passwd", "r")); return event_loop.exec(); }