浏览代码

touch: Use pledge()

Andreas Kling 5 年之前
父节点
当前提交
feb4c683eb
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Userland/touch.cpp

+ 5 - 0
Userland/touch.cpp

@@ -50,6 +50,11 @@ static bool file_exists(const char* path)
 
 int main(int argc, char** argv)
 {
+    if (pledge("stdio rpath cpath fattr", nullptr)) {
+        perror("pledge");
+        return 1;
+    }
+
     if (argc != 2) {
         fprintf(stderr, "usage: touch <path>\n");
         return 1;