From 8c42e565665bf1f97898359f93ca3927a76dc753 Mon Sep 17 00:00:00 2001 From: ProsperousPotato Date: Sun, 27 Jul 2025 23:32:27 +0100 Subject: add support for OpenBSD pledge() --- main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index caabbc2..1d2acb9 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,7 @@ #include +#include + #include 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; -- cgit v1.2.3