diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-05-25 12:04:22 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-05-25 12:04:22 +0200 |
commit | cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c (patch) | |
tree | 469c5c4b629307bf1b200161bcdb3534938233b5 | |
parent | e75494b730ea6883e68072a106a09a301cfaf845 (diff) |
Pledge on OpenBSD
-rw-r--r-- | dmenu.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -24,6 +24,12 @@ | |||
24 | #define LENGTH(X) (sizeof X / sizeof X[0]) | 24 | #define LENGTH(X) (sizeof X / sizeof X[0]) |
25 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) | 25 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) |
26 | 26 | ||
27 | #ifdef __OpenBSD__ | ||
28 | #include <unistd.h> | ||
29 | #else | ||
30 | #define pledge(a,b) 0 | ||
31 | #endif | ||
32 | |||
27 | /* enums */ | 33 | /* enums */ |
28 | enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ | 34 | enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ |
29 | 35 | ||
@@ -746,6 +752,9 @@ main(int argc, char *argv[]) | |||
746 | die("no fonts could be loaded."); | 752 | die("no fonts could be loaded."); |
747 | lrpad = drw->fonts->h; | 753 | lrpad = drw->fonts->h; |
748 | 754 | ||
755 | if (pledge("stdio rpath", NULL) < 0) | ||
756 | die("pledge"); | ||
757 | |||
749 | if (fast) { | 758 | if (fast) { |
750 | grabkeyboard(); | 759 | grabkeyboard(); |
751 | readstdin(); | 760 | readstdin(); |