diff options
author | Ashe Connor <ashe@kivikakk.ee> | 2018-11-21 13:34:07 +1100 |
---|---|---|
committer | Ashe Connor <ashe@kivikakk.ee> | 2018-11-21 07:28:30 +1100 |
commit | 0d6062b80621cd52500b69c3fc0f1018e9aba7ad (patch) | |
tree | 6f48f10c4861c8240c170ebe735e81a94bcb97d4 /src/main.c | |
parent | 65110289fa5c284883bea92ed72d2bfcdfb761ba (diff) |
check for OpenBSD 5.9+
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -8,7 +8,11 @@ #include "node.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__) @@ -81,7 +85,7 @@ int main(int argc, char *argv[]) { writer_format writer = FORMAT_HTML; int options = CMARK_OPT_DEFAULT; -#if defined(__OpenBSD__) +#ifdef USE_PLEDGE if (pledge("stdio rpath", NULL) != 0) { perror("pledge"); return 1; @@ -187,7 +191,7 @@ int main(int argc, char *argv[]) { } } -#if defined(__OpenBSD__) +#ifdef USE_PLEDGE if (pledge("stdio", NULL) != 0) { perror("pledge"); return 1; |