mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
Breakout: use pledge and unveil
This commit is contained in:
parent
e3114667bc
commit
d8c533f588
Notes:
sideshowbarker
2024-07-19 00:49:07 +09:00
Author: https://github.com/bcoles
Commit: d8c533f588
Pull-request: https://github.com/SerenityOS/serenity/pull/4420
1 changed files with 21 additions and 0 deletions
|
@ -35,7 +35,28 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath wpath cpath shared_buffer accept unix fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
if (pledge("stdio rpath shared_buffer", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil(nullptr, nullptr) < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->resize(Breakout::Game::game_width, Breakout::Game::game_height);
|
||||
auto app_icon = GUI::Icon::default_icon("app-breakout");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue