pledge for xclock. okan@ got to the same patch. I added autoconf goo

to make it possible to send it upstreams. ok deraadt@
This commit is contained in:
matthieu 2015-11-11 21:12:19 +00:00
parent f7d98a310c
commit eedb4e77fa
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,7 @@ AC_CONFIG_HEADERS([config.h])
AC_CHECK_FUNCS([strlcpy getpid])
AC_CHECK_FUNCS([strlcpy getpid pledge])
AM_ICONV

View File

@ -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);
}