changeset 13422:e81addc3d284

priv-set: Don't assume that priv.h exists merely because getppriv does. See Jan Andersen's bug report about AIX 5L in http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00019.html * m4/priv-set.m4 (gl_PRIV_SET): Check for priv.h. * lib/priv-set.c: Do nothing unless HAVE_PRIV_H. * lib/priv-set.h: Likewise. * tests/test-priv-set.c: Likewise.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 14 Jun 2010 12:20:22 -0700
parents 5dc27513d127
children ba0385f65ed2
files ChangeLog lib/priv-set.c lib/priv-set.h m4/priv-set.m4 tests/test-priv-set.c
diffstat 5 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+	priv-set: Don't assume that priv.h exists merely because getppriv does.
+	See Jan Andersen's bug report about AIX 5L in
+	http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00019.html
+	* m4/priv-set.m4 (gl_PRIV_SET): Check for priv.h.
+	* lib/priv-set.c: Do nothing unless HAVE_PRIV_H.
+	* lib/priv-set.h: Likewise.
+	* tests/test-priv-set.c: Likewise.
+
 2010-06-13  Bruno Haible  <bruno@clisp.org>
 
 	relocatable: Make it easier to test whether to install wrappers.
--- a/lib/priv-set.c
+++ b/lib/priv-set.c
@@ -20,7 +20,7 @@
 #include <config.h>
 #include "priv-set.h"
 
-#if HAVE_GETPPRIV
+#if HAVE_GETPPRIV && HAVE_PRIV_H
 
 # include <errno.h>
 # include <stdbool.h>
--- a/lib/priv-set.h
+++ b/lib/priv-set.h
@@ -17,7 +17,7 @@
 
    Written by David Bartley.  */
 
-#if HAVE_GETPPRIV
+#if HAVE_GETPPRIV && HAVE_PRIV_H
 
 # include <priv.h>
 
--- a/m4/priv-set.m4
+++ b/m4/priv-set.m4
@@ -1,4 +1,4 @@
-# serial 6
+# serial 7
 
 # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
@@ -12,4 +12,5 @@
 [
   AC_REQUIRE([AC_C_INLINE])
   AC_CHECK_FUNCS([getppriv])
+  AC_CHECK_HEADERS_ONCE([priv.h])
 ])
--- a/tests/test-priv-set.c
+++ b/tests/test-priv-set.c
@@ -20,7 +20,7 @@
 
 #include "priv-set.h"
 
-#if HAVE_GETPPRIV
+#if HAVE_GETPPRIV && HAVE_PRIV_H
 # include <priv.h>
 #endif
 #include <unistd.h>
@@ -32,7 +32,7 @@
 int
 main (void)
 {
-#if HAVE_GETPPRIV
+#if HAVE_GETPPRIV && HAVE_PRIV_H
     priv_set_t *set;
 
     ASSERT (set = priv_allocset ());