Games: Use pledge()

This commit is contained in:
Andreas Kling 2020-01-12 12:29:40 +01:00
parent d1839ae0c9
commit df7b81bdf5
2 changed files with 23 additions and 0 deletions

View file

@ -10,11 +10,23 @@
#include <LibGUI/GMenu.h>
#include <LibGUI/GMenuBar.h>
#include <LibGUI/GWindow.h>
#include <stdio.h>
int main(int argc, char** argv)
{
if (pledge("stdio rpath wpath cpath shared_buffer unix fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
GApplication app(argc, argv);
if (pledge("stdio rpath wpath cpath shared_buffer", nullptr) < 0) {
perror("pledge");
return 1;
}
auto window = GWindow::construct();
window->set_resizable(false);
window->set_title("Minesweeper");

View file

@ -8,11 +8,22 @@
#include <LibGUI/GMenu.h>
#include <LibGUI/GMenuBar.h>
#include <LibGUI/GWindow.h>
#include <stdio.h>
int main(int argc, char** argv)
{
if (pledge("stdio rpath cpath shared_buffer unix fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
GApplication app(argc, argv);
if (pledge("stdio rpath shared_buffer", nullptr) < 0) {
perror("pledge");
return 1;
}
auto window = GWindow::construct();
window->set_double_buffering_enabled(false);