Browse Source

code-style for pledge(2)

feedback from Klemens, thanks
master
Hiltjo Posthuma 6 years ago
parent
commit
05c138f5b8
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      dmenu.c

+ 5
- 6
dmenu.c View File

@ -6,6 +6,9 @@
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <time.h> #include <time.h>
#ifdef __OpenBSD__
#include <unistd.h>
#endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -24,12 +27,6 @@
#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 */
@ -752,8 +749,10 @@ 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;
#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) < 0) if (pledge("stdio rpath", NULL) < 0)
die("pledge"); die("pledge");
#endif
if (fast) { if (fast) {
grabkeyboard(); grabkeyboard();


Loading…
Cancel
Save