all repos — dmenu @ 05c138f5b8f19070a190b97728c83b454855f52b

my build of dmenu

code-style for pledge(2)

feedback from Klemens, thanks
Hiltjo Posthuma hiltjo@codemadness.org
Fri, 25 May 2018 13:03:25 +0200
commit

05c138f5b8f19070a190b97728c83b454855f52b

parent

cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c

1 files changed, 5 insertions(+), 6 deletions(-)

jump to
M dmenu.cdmenu.c

@@ -6,6 +6,9 @@ #include <stdlib.h>

#include <string.h> #include <strings.h> #include <time.h> +#ifdef __OpenBSD__ +#include <unistd.h> +#endif #include <X11/Xlib.h> #include <X11/Xatom.h>

@@ -23,12 +26,6 @@ #define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \

* MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) #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 @@ if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))

die("no fonts could be loaded."); lrpad = drw->fonts->h; +#ifdef __OpenBSD__ if (pledge("stdio rpath", NULL) < 0) die("pledge"); +#endif if (fast) { grabkeyboard();