autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ac-type-getgroups.patch


From: Akim Demaille
Subject: ac-type-getgroups.patch
Date: 03 Feb 2001 17:57:50 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake)

Err, cleaning my disk, I found this.  I have no idea what was the
motivation, please tell me if I just throw away, or apply.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        * acspecific.m4 (AC_TYPE_GETGROUPS): Check for unistd.h, and
        include it to get getgroups' prototype.
        
Index: acspecific.m4
===================================================================
RCS file: /cvs/autoconf/acspecific.m4,v
retrieving revision 1.295
diff -u -r1.295 acspecific.m4
--- acspecific.m4       2000/09/06 13:05:58     1.295
+++ acspecific.m4       2000/09/08 15:33:06
@@ -677,13 +677,19 @@
 # -----------------
 AC_DEFUN([AC_TYPE_GETGROUPS],
 [AC_REQUIRE([AC_TYPE_UID_T])dnl
+AC_CHECK_HEADERS(unistd.h)
 AC_CACHE_CHECK(type of array argument to getgroups, ac_cv_type_getgroups,
 [AC_TRY_RUN(
 [/* Thanks to Mike Rendell for this test.  */
 #include <sys/types.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 #define NGID 256
 #undef MAX
 #define MAX(x, y) ((x) > (y) ? (x) : (y))
+
 int
 main ()
 {
@@ -694,18 +700,20 @@
   val.lval = -1;
   for (i = 0; i < NGID; i++)
     gidset[i] = val.gval;
-  n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
+  n = getgroups (sizeof (gidset) / MAX (sizeof (int),
+                 sizeof (gid_t)) - 1,
                  gidset);
   /* Exit non-zero if getgroups seems to require an array of ints.  This
      happens when gid_t is short but getgroups modifies an array of ints.  */
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
 }],
-  ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int,
-  ac_cv_type_getgroups=cross)
+            [ac_cv_type_getgroups=gid_t],
+            [ac_cv_type_getgroups=int],
+            [ac_cv_type_getgroups=cross])
 if test $ac_cv_type_getgroups = cross; then
-  dnl When we can't run the test program (we are cross compiling), presume
-  dnl that <unistd.h> has either an accurate prototype for getgroups or none.
-  dnl Old systems without prototypes probably use int.
+  # When we can't run the test program (we are cross compiling), presume
+  # that <unistd.h> has either an accurate prototype for getgroups or none.
+  # Old systems without prototypes probably use int.
   AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
                  ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
 fi])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]