[PATCH 1/2] xfree86: Check for issetugid declaration

Julien Cristau jcristau at debian.org
Sat Jul 27 12:08:28 PDT 2013


Avoids 'implicit function declaration' build error on gnu/kfreebsd.

Signed-off-by: Julien Cristau <jcristau at debian.org>
---
 configure.ac                 |    1 +
 hw/xfree86/common/xf86Init.c |    2 +-
 include/xorg-config.h.in     |    4 ++++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index c6ecba4..a93e903 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,6 +213,7 @@ AC_CHECK_FUNC([dlopen], [],
 AC_SUBST(DLOPEN_LIBS)
 
 dnl Checks for library functions.
+AC_CHECK_DECLS([issetugid])
 AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \
 	getdtablesize getifaddrs getpeereid getpeerucred getzoneid \
 	mmap shmctl64 strncasecmp vasprintf vsnprintf walkcontext])
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 91ec4c8..6caaa51 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -253,7 +253,7 @@ xf86PrivsElevated(void)
             privsElevated = TRUE;
         }
         else {
-#if defined(HAVE_ISSETUGID)
+#if defined(HAVE_ISSETUGID) && HAVE_DECL_ISSETUGID
             privsElevated = issetugid();
 #elif defined(HAVE_GETRESUID)
             uid_t ruid, euid, suid;
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index a71b25d..d9e7ec5 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -130,6 +130,10 @@
 /* Use libpciaccess */
 #undef XSERVER_LIBPCIACCESS
 
+/* Define to 1 if you have the declaration of `issetugid', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISSETUGID
+
 /* Have setugid */
 #undef HAVE_ISSETUGID
 
-- 
1.7.10.4



More information about the xorg-devel mailing list