diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2015-11-11 21:12:20 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2015-11-11 21:12:20 +0000 |
commit | be3df29c13f26b59276b8d622ca6b338661c46a9 (patch) | |
tree | d926063176189dfe2e28fb33163d704ce7d31d8a /app/xclock | |
parent | 7fb4cc9bc284cff187c9b9212e5bebdf267df0df (diff) |
pledge for xclock. okan@ got to the same patch. I added autoconf goo
to make it possible to send it upstreams. ok deraadt@
Diffstat (limited to 'app/xclock')
-rw-r--r-- | app/xclock/configure.ac | 2 | ||||
-rw-r--r-- | app/xclock/xclock.c | 8 |
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); } |