Welcome: Add pledge and unveil

This commit is contained in:
thatlittlegit 2020-02-14 13:12:03 -05:00 committed by Andreas Kling
parent 37daae1451
commit 7caa8b7531
Notes: sideshowbarker 2024-07-19 17:41:20 +09:00

View file

@ -34,6 +34,8 @@
#include <LibGUI/StackWidget.h>
#include <LibGUI/Window.h>
#include <LibGfx/Font.h>
#include <stdio.h>
#include <unistd.h>
#include "BackgroundWidget.h"
#include "TextWidget.h"
@ -85,8 +87,24 @@ int main(int argc, char** argv)
},
};
if (pledge("stdio shared_buffer rpath unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
GUI::Application app(argc, argv);
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/res/fonts", "r") < 0) {
perror("unveil");
return 1;
}
unveil(nullptr, nullptr);
auto window = GUI::Window::construct();
window->set_title("Welcome to Serenity");
Gfx::Rect window_rect { 0, 0, 640, 360 };