summaryrefslogtreecommitdiff
path: root/Ports/thesilversearcher/patches/0001-Add-the-thread-pledge-to-the-pledge-list.patch
blob: 6437742bc74853ffcb8059f68872600ef8a9297d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raymond Lucke <ray@raylucke.com>
Date: Sat, 14 May 2022 13:25:23 -0400
Subject: [PATCH] Add the thread pledge to the pledge list

On OpenBSD, stdio typically grants thread, but on Serenity it is its own
option.
---
 src/main.c    | 4 ++--
 src/options.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 6de2038..5b4029c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
     int num_cores;
 
 #ifdef HAVE_PLEDGE
-    if (pledge("stdio rpath proc exec", NULL) == -1) {
+    if (pledge("stdio rpath proc exec thread", NULL) == -1) {
         die("pledge: %s", strerror(errno));
     }
 #endif
@@ -177,7 +177,7 @@ int main(int argc, char **argv) {
         }
 
 #ifdef HAVE_PLEDGE
-        if (pledge("stdio rpath", NULL) == -1) {
+        if (pledge("stdio rpath thread", NULL) == -1) {
             die("pledge: %s", strerror(errno));
         }
 #endif
diff --git a/src/options.c b/src/options.c
index e63985e..72f88b8 100644
--- a/src/options.c
+++ b/src/options.c
@@ -642,7 +642,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
 
 #ifdef HAVE_PLEDGE
     if (opts.skip_vcs_ignores) {
-        if (pledge("stdio rpath proc", NULL) == -1) {
+        if (pledge("stdio rpath proc thread", NULL) == -1) {
             die("pledge: %s", strerror(errno));
         }
     }
@@ -717,7 +717,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
     }
 
 #ifdef HAVE_PLEDGE
-    if (pledge("stdio rpath proc", NULL) == -1) {
+    if (pledge("stdio rpath proc thread", NULL) == -1) {
         die("pledge: %s", strerror(errno));
     }
 #endif