浏览代码

TextEditor: Use pledge()

Andreas Kling 5 年之前
父节点
当前提交
2067c003ff
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      Applications/TextEditor/main.cpp

+ 11 - 0
Applications/TextEditor/main.cpp

@@ -1,10 +1,21 @@
 #include "TextEditorWidget.h"
 #include <LibDraw/PNGLoader.h>
+#include <stdio.h>
 
 int main(int argc, char** argv)
 {
+    if (pledge("stdio rpath cpath wpath shared_buffer unix fattr", nullptr) < 0) {
+        perror("pledge");
+        return 1;
+    }
+
     GApplication app(argc, argv);
 
+    if (pledge("stdio rpath cpath wpath shared_buffer unix", nullptr) < 0) {
+        perror("pledge");
+        return 1;
+    }
+
     auto window = GWindow::construct();
     window->set_title("Text Editor");
     window->set_rect(20, 200, 640, 400);