openbsd-ports/x11/lemonbar-xft/patches/patch-lemonbar_c
2022-03-11 20:15:18 +00:00

22 lines
506 B
Plaintext

Index: lemonbar.c
--- lemonbar.c.orig
+++ lemonbar.c
@@ -1,5 +1,4 @@
// vim:sw=4:ts=4:et:
-#define _POSIX_C_SOURCE 200809L
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
@@ -1538,6 +1537,11 @@ main (int argc, char **argv)
// Prevent fgets to block
fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
+ if (pledge("stdio", NULL) == -1) {
+ fprintf(stderr, "pledge: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+
for (;;) {
bool redraw = false;