all repos — dmenu @ cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c

my build of dmenu

Pledge on OpenBSD
Hiltjo Posthuma hiltjo@codemadness.org
Fri, 25 May 2018 12:04:22 +0200
commit

cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c

parent

e75494b730ea6883e68072a106a09a301cfaf845

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M dmenu.cdmenu.c

@@ -24,6 +24,12 @@ * 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 */

@@ -745,6 +751,9 @@ drw = drw_create(dpy, screen, root, wa.width, wa.height);

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