Chess: Perform pledges earlier

This commit is contained in:
Luke Wilde 2021-08-27 15:14:15 +01:00 committed by Ali Mohammad Pur
parent fd51a3cf15
commit 4332b35798
Notes: sideshowbarker 2024-07-18 05:10:06 +09:00

View file

@ -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;