aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 13:03:25 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-05-25 13:03:25 +0200
commit05c138f5b8f19070a190b97728c83b454855f52b (patch)
tree6ccef5028d80e0f0db6461d6b1527655b0e2ecf0 /dmenu.c
parentcd132c8d5b17ac2f4a3e611836d4cde4995d7a0c (diff)
downloaddmenu-05c138f5b8f19070a190b97728c83b454855f52b.tar.gz
dmenu-05c138f5b8f19070a190b97728c83b454855f52b.tar.bz2
dmenu-05c138f5b8f19070a190b97728c83b454855f52b.zip
code-style for pledge(2)
feedback from Klemens, thanks
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/dmenu.c b/dmenu.c
index 7745947..3b2f3ec 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -6,6 +6,9 @@
#include <string.h>
#include <strings.h>
#include <time.h>
+#ifdef __OpenBSD__
+#include <unistd.h>
+#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -24,12 +27,6 @@
#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 */
@@ -752,8 +749,10 @@ main(int argc, char *argv[])
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
+#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) < 0)
die("pledge");
+#endif
if (fast) {
grabkeyboard();