priv-set: Don't assume that priv.h exists merely because getppriv does.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Jun 2010 19:20:22 +0000 (12:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Jun 2010 19:20:22 +0000 (12:20 -0700)
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.

ChangeLog
lib/priv-set.c
lib/priv-set.h
m4/priv-set.m4
tests/test-priv-set.c

index dfcc99a..7cfad41 100644 (file)
--- 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.
index 911c280..0ac1b97 100644 (file)
@@ -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>
index b8f8b72..5cac9ce 100644 (file)
@@ -17,7 +17,7 @@
 
    Written by David Bartley.  */
 
-#if HAVE_GETPPRIV
+#if HAVE_GETPPRIV && HAVE_PRIV_H
 
 # include <priv.h>
 
index 205b00c..aaa1896 100644 (file)
@@ -1,4 +1,4 @@
-# serial 6
+# serial 7
 
 # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
@@ -12,4 +12,5 @@ AC_DEFUN([gl_PRIV_SET],
 [
   AC_REQUIRE([AC_C_INLINE])
   AC_CHECK_FUNCS([getppriv])
+  AC_CHECK_HEADERS_ONCE([priv.h])
 ])
index 49ad388..4b17f0c 100644 (file)
@@ -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 ());