From 59f74541fbb0ccfb99d2d52cea4b8867542bc581 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 25 May 2018 13:03:25 +0200 Subject: [PATCH] code-style for pledge(2) feedback from Klemens, thanks --- dmenubar/dmenu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dmenubar/dmenu.c b/dmenubar/dmenu.c index 7745947..3b2f3ec 100644 --- a/dmenubar/dmenu.c +++ b/dmenubar/dmenu.c @@ -6,6 +6,9 @@ #include #include #include +#ifdef __OpenBSD__ +#include +#endif #include #include @@ -24,12 +27,6 @@ #define LENGTH(X) (sizeof X / sizeof X[0]) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) -#ifdef __OpenBSD__ -#include -#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();