aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
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 /dmenu.c
parente75494b730ea6883e68072a106a09a301cfaf845 (diff)
downloaddmenu-cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c.tar.gz
dmenu-cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c.tar.bz2
dmenu-cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c.zip
Pledge on OpenBSD
Diffstat (limited to 'dmenu.c')
-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 @@
#define LENGTH(X) (sizeof X / sizeof X[0])
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
+#ifdef __OpenBSD__
+#include <unistd.h>
+#else
+#define pledge(a,b) 0
+#endif
+
/* enums */
enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
@@ -746,6 +752,9 @@ main(int argc, char *argv[])
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
+ if (pledge("stdio rpath", NULL) < 0)
+ die("pledge");
+
if (fast) {
grabkeyboard();
readstdin();