mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
CatDog: Add pledge() and lock unveil state
This commit is contained in:
parent
959970e060
commit
24d6814ee5
1 changed files with 10 additions and 0 deletions
|
@ -194,6 +194,11 @@ private:
|
|||
|
||||
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);
|
||||
auto app_icon = GUI::Icon::default_icon("app-catdog");
|
||||
|
||||
|
@ -207,6 +212,11 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (unveil(nullptr, nullptr) < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("CatDog Demo");
|
||||
window->resize(32, 32);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue