File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 7
7
#include "cmark.h"
8
8
#include "node.h"
9
9
10
+ #if defined(__OpenBSD__ )
11
+ #include <unistd.h>
12
+ #endif
13
+
10
14
#if defined(_WIN32 ) && !defined(__CYGWIN__ )
11
15
#include <io.h>
12
16
#include <fcntl.h>
@@ -77,6 +81,13 @@ int main(int argc, char *argv[]) {
77
81
writer_format writer = FORMAT_HTML ;
78
82
int options = CMARK_OPT_DEFAULT ;
79
83
84
+ #if defined(__OpenBSD__ )
85
+ if (pledge ("stdio rpath" , NULL ) != 0 ) {
86
+ perror ("pledge" );
87
+ return 1 ;
88
+ }
89
+ #endif
90
+
80
91
#if defined(_WIN32 ) && !defined(__CYGWIN__ )
81
92
_setmode (_fileno (stdin ), _O_BINARY );
82
93
_setmode (_fileno (stdout ), _O_BINARY );
@@ -176,6 +187,13 @@ int main(int argc, char *argv[]) {
176
187
}
177
188
}
178
189
190
+ #if defined(__OpenBSD__ )
191
+ if (pledge ("stdio" , NULL ) != 0 ) {
192
+ perror ("pledge" );
193
+ return 1 ;
194
+ }
195
+ #endif
196
+
179
197
document = cmark_parser_finish (parser );
180
198
cmark_parser_free (parser );
181
199
You can’t perform that action at this time.
0 commit comments