Selaa lähdekoodia

touch: Use pledge()

Andreas Kling 5 vuotta sitten
vanhempi
commit
feb4c683eb
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  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;