diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-26 23:03:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-26 23:27:57 +0100 |
commit | 1ded1ed963f703755f475fe4b8688f783f3a83e4 (patch) | |
tree | 55fc65cb151042424369f3a251189926fcc006f8 /Userland/Applications/Run/main.cpp | |
parent | 0b8fb8358e2502cf34e72444d7be5e259e937544 (diff) | |
download | serenity-1ded1ed963f703755f475fe4b8688f783f3a83e4.zip |
Run: Port to LibMain :^)
Diffstat (limited to 'Userland/Applications/Run/main.cpp')
-rw-r--r-- | Userland/Applications/Run/main.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
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 <AK/StringBuilder.h> +#include <LibCore/System.h> #include <LibGUI/Application.h> #include <LibGUI/Desktop.h> -#include <unistd.h> +#include <LibMain/Main.h> -int main(int argc, char** argv) +ErrorOr<int> 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(); |