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 +#endif #include #include #include @@ -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); }