mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 02:50:26 +00:00
CatDog: Add pledge() and lock unveil state
This commit is contained in:
parent
959970e060
commit
24d6814ee5
Notes:
sideshowbarker
2024-07-18 23:54:38 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/24d6814ee56 Pull-request: https://github.com/SerenityOS/serenity/pull/4918
1 changed files with 10 additions and 0 deletions
|
@ -194,6 +194,11 @@ private:
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
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 = GUI::Application::construct(argc, argv);
|
||||||
auto app_icon = GUI::Icon::default_icon("app-catdog");
|
auto app_icon = GUI::Icon::default_icon("app-catdog");
|
||||||
|
|
||||||
|
@ -207,6 +212,11 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unveil(nullptr, nullptr) < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
window->set_title("CatDog Demo");
|
window->set_title("CatDog Demo");
|
||||||
window->resize(32, 32);
|
window->resize(32, 32);
|
||||||
|
|
Loading…
Reference in a new issue