aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-07-27 23:32:27 +0100
committerProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-07-27 23:32:27 +0100
commit8c42e565665bf1f97898359f93ca3927a76dc753 (patch)
tree088bf595ccf19f4d7f710405549c5714375d2b78 /main.c
parent4b4bfa9c4707eded5dc1d93dac316efe67666341 (diff)
add support for OpenBSD pledge()
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index caabbc2..1d2acb9 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,7 @@
#include <X11/extensions/XInput2.h>
+#include <unistd.h>
+
#include <stdio.h>
static void xi_select_events(int);
@@ -18,6 +20,12 @@ void xi_select_events(const int event) {
}
int main(void) {
+
+#ifdef __OpenBSD__
+ if (pledge("stdio unix inet rpath", NULL) == -1)
+ fprintf(stderr, "pledge: failed\n");
+#endif
+
if (!(d = XOpenDisplay(NULL))) {
printf("Couldn't open Display.\n");
return 1;