summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/xclock/configure.ac2
-rw-r--r--app/xclock/xclock.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/xclock/configure.ac b/app/xclock/configure.ac
index 9dc15f628..384c9c4c7 100644
--- a/app/xclock/configure.ac
+++ b/app/xclock/configure.ac
@@ -39,7 +39,7 @@ AC_CONFIG_HEADERS([config.h])
-AC_CHECK_FUNCS([strlcpy getpid])
+AC_CHECK_FUNCS([strlcpy getpid pledge])
AM_ICONV
diff --git a/app/xclock/xclock.c b/app/xclock/xclock.c
index 2533dede2..36daa16fd 100644
--- a/app/xclock/xclock.c
+++ b/app/xclock/xclock.c
@@ -37,6 +37,9 @@ in this Software without prior written authorization from The Open Group.
# include "config.h"
#endif
+#ifdef HAVE_PLEDGE
+# include <err.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xatom.h>
@@ -224,6 +227,11 @@ main(int argc, char *argv[])
}
#endif
+#ifdef HAVE_PLEDGE
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+#endif
+
XtAppMainLoop (app_con);
exit(0);
}