Pledge on OpenBSD
parent
e75494b730
commit
cd132c8d5b
9
dmenu.c
9
dmenu.c
|
@ -24,6 +24,12 @@
|
||||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#define pledge(a,b) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
|
enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
|
||||||
|
|
||||||
|
@ -746,6 +752,9 @@ main(int argc, char *argv[])
|
||||||
die("no fonts could be loaded.");
|
die("no fonts could be loaded.");
|
||||||
lrpad = drw->fonts->h;
|
lrpad = drw->fonts->h;
|
||||||
|
|
||||||
|
if (pledge("stdio rpath", NULL) < 0)
|
||||||
|
die("pledge");
|
||||||
|
|
||||||
if (fast) {
|
if (fast) {
|
||||||
grabkeyboard();
|
grabkeyboard();
|
||||||
readstdin();
|
readstdin();
|
||||||
|
|
Loading…
Reference in New Issue