aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 12:04:22 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 12:04:22 +0200
commitcd132c8d5b17ac2f4a3e611836d4cde4995d7a0c (patch)
tree469c5c4b629307bf1b200161bcdb3534938233b5
parente75494b730ea6883e68072a106a09a301cfaf845 (diff)
Pledge on OpenBSD
-rw-r--r--dmenu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dmenu.c b/dmenu.c
index d764658..7745947 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -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 */
28enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ 34enum { 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();