]> Savannah Git Hosting - gnulib.git/commitdiff
mgetgroups: fix port to strict OS X
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Jun 2015 02:12:07 +0000 (19:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Jun 2015 02:17:54 +0000 (19:17 -0700)
* m4/mgetgroups.m4 (gl_MGETGROUPS):
Use more-sensitive -Werror setting if available.

ChangeLog
m4/mgetgroups.m4

index 465bf0ef50ed3e1db35036697d0e9a794f6d1c84..cb6ca08b6a38e785f6be51ade0b011092ef9af28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-06-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       mgetgroups: port to strict OS X
+       * doc/glibc-functions/getgrouplist.texi (getgrouplist):
+       Document the getgrouplist problem.
+       * lib/mgetgroups.c (getgrouplist_gids) [HAVE_GETGROUPLIST]:
+       New macro.
+       (mgetgroups): Use it.
+       * m4/mgetgroups.m4 (gl_MGETGROUPS):
+       Check for OS X signature for getgrouplist.
+
 2015-06-29  Jim Meyering  <meyering@fb.com>
 
        linkat: fix invalid definition of LINKAT_SYMLINK_NOTSUP on OS X
index 5f19d4f6062227e613ba021312dcc471575a5516..5747148c718226512f257d60328b3ce2b0f936fd 100644 (file)
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
 dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,6 +12,8 @@ AC_DEFUN([gl_MGETGROUPS],
     AC_CACHE_CHECK([for getgrouplist with int signature],
       [gl_cv_getgrouplist_with_int],
       [gl_cv_getgrouplist_with_int=no
+       gl_save_c_werror_flag=$ac_c_werror_flag
+       ac_c_werror_flag=yes
        AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
             [[#if HAVE_GRP_H
@@ -19,11 +21,8 @@ AC_DEFUN([gl_MGETGROUPS],
               #endif
               int groups[1];
               int ngroups = 1;
-              int getgrouplist (char const *, gid_t, gid_t *, int *);
             ]],
-            [[
-              return - getgrouplist ("root", 0, groups, &ngroups);
-            ]])],
+            [[return - getgrouplist ("root", 0, groups, &ngroups);]])],
          [],
          [AC_COMPILE_IFELSE(
            [AC_LANG_PROGRAM(
@@ -32,12 +31,10 @@ AC_DEFUN([gl_MGETGROUPS],
                 #endif
                 int groups[sizeof (gid_t) == sizeof (int) ? 1 : -1];
                 int ngroups = 1;
-                int getgrouplist (char const *, int, int *, int *);
               ]],
-              [[
-                return - getgrouplist ("root", 0, groups, &ngroups);
-              ]])],
-            [gl_cv_getgrouplist_with_int=yes])])])
+              [[return - getgrouplist ("root", 0, groups, &ngroups);]])],
+            [gl_cv_getgrouplist_with_int=yes])])
+       ac_c_werror_flag=$gl_save_c_werror_flag])
     if test "$gl_cv_getgrouplist_with_int" = yes; then
       AC_DEFINE([HAVE_GETGROUPLIST_WITH_INT], 1,
         [Define to 1 if getgrouplist accepts and returns int and not gid_t.])