From 1ded1ed963f703755f475fe4b8688f783f3a83e4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 26 Nov 2021 23:03:54 +0100 Subject: [PATCH] Run: Port to LibMain :^) --- Userland/Applications/Run/CMakeLists.txt | 2 +- Userland/Applications/Run/main.cpp | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Userland/Applications/Run/CMakeLists.txt b/Userland/Applications/Run/CMakeLists.txt index 1a4f65d4f5..0fe582ce82 100644 --- a/Userland/Applications/Run/CMakeLists.txt +++ b/Userland/Applications/Run/CMakeLists.txt @@ -14,4 +14,4 @@ set(SOURCES ) serenity_app(Run ICON app-run) -target_link_libraries(Run LibCore LibDesktop LibGUI) +target_link_libraries(Run LibCore LibDesktop LibGUI LibMain) diff --git a/Userland/Applications/Run/main.cpp b/Userland/Applications/Run/main.cpp index 82ef0ee165..207839b8ec 100644 --- a/Userland/Applications/Run/main.cpp +++ b/Userland/Applications/Run/main.cpp @@ -5,20 +5,17 @@ */ #include "RunWindow.h" -#include +#include #include #include -#include +#include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio recvfd sendfd thread cpath rpath wpath unix proc exec", nullptr)); - auto app = GUI::Application::construct(argc, argv); - auto window = RunWindow::construct(); + auto app = TRY(GUI::Application::try_create(arguments)); + auto window = TRY(RunWindow::try_create()); window->move_to(16, GUI::Desktop::the().rect().bottom() - GUI::Desktop::the().taskbar_height() - 16 - window->height()); window->show();