We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6511028 commit 0d6062bCopy full SHA for 0d6062b
src/main.c
@@ -8,7 +8,11 @@
8
#include "node.h"
9
10
#if defined(__OpenBSD__)
11
-#include <unistd.h>
+# include <sys/param.h>
12
+# if OpenBSD >= 201605
13
+# define USE_PLEDGE
14
+# include <unistd.h>
15
+# endif
16
#endif
17
18
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -81,7 +85,7 @@ int main(int argc, char *argv[]) {
81
85
writer_format writer = FORMAT_HTML;
82
86
int options = CMARK_OPT_DEFAULT;
83
87
84
-#if defined(__OpenBSD__)
88
+#ifdef USE_PLEDGE
89
if (pledge("stdio rpath", NULL) != 0) {
90
perror("pledge");
91
return 1;
@@ -187,7 +191,7 @@ int main(int argc, char *argv[]) {
187
191
}
188
192
189
193
190
194
195
if (pledge("stdio", NULL) != 0) {
196
197
0 commit comments