diff options
author | Luke Wilde <lukew@serenityos.org> | 2021-08-27 15:14:15 +0100 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-08-28 12:22:16 +0430 |
commit | 4332b357985d511b4677857b9c893ba2934b7cd5 (patch) | |
tree | 26b9ef4111e3d58063494ca8248328fa287584e3 /Userland | |
parent | fd51a3cf1544ed9aae456e30fe722b982fa141b3 (diff) | |
download | serenity-4332b357985d511b4677857b9c893ba2934b7cd5.zip |
Chess: Perform pledges earlier
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Games/Chess/main.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index 714983baf8..04e61dc061 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -20,11 +20,12 @@ int main(int argc, char** argv) { - auto app = GUI::Application::construct(argc, argv); - auto app_icon = GUI::Icon::default_icon("app-chess"); + if (pledge("stdio rpath wpath cpath recvfd sendfd thread proc exec unix", nullptr) < 0) { + perror("pledge"); + return 1; + } - auto window = GUI::Window::construct(); - auto& widget = window->set_main_widget<ChessWidget>(); + auto app = GUI::Application::construct(argc, argv); Config::pledge_domains("Chess"); @@ -33,6 +34,11 @@ int main(int argc, char** argv) return 1; } + auto app_icon = GUI::Icon::default_icon("app-chess"); + + auto window = GUI::Window::construct(); + auto& widget = window->set_main_widget<ChessWidget>(); + if (unveil("/res", "r") < 0) { perror("unveil"); return 1; |