Skip to content

Commit

Permalink
check for OpenBSD 5.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Nov 21, 2018
1 parent 44eafe0 commit 42f5a52
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
#include "../extensions/cmark-gfm-core-extensions.h"

#if defined(__OpenBSD__)
#include <unistd.h>
# include <sys/param.h>
# if OpenBSD >= 201605
# define USE_PLEDGE
# include <unistd.h>
# endif
#endif

#if defined(_WIN32) && !defined(__CYGWIN__)
Expand Down Expand Up @@ -121,7 +125,7 @@ int main(int argc, char *argv[]) {
int options = CMARK_OPT_DEFAULT;
int res = 1;

#if defined(__OpenBSD__)
#ifdef USE_PLEDGE
if (pledge("stdio rpath", NULL) != 0) {
perror("pledge");
return 1;
Expand Down Expand Up @@ -275,7 +279,7 @@ int main(int argc, char *argv[]) {
}
}

#if defined(__OpenBSD__)
#ifdef USE_PLEDGE
if (pledge("stdio", NULL) != 0) {
perror("pledge");
return 1;
Expand Down

0 comments on commit 42f5a52

Please sign in to comment.