# HG changeset patch # User Paul Eggert # Date 1435630327 25200 # Node ID e856c861873802eb2021a8ceeff839c54a4bb77c # Parent bbdce0795bb7b4af6387dd5aaf71e268540d9d6a mgetgroups: fix port to strict OS X * m4/mgetgroups.m4 (gl_MGETGROUPS): Use more-sensitive -Werror setting if available. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2015-06-29 Paul Eggert + + 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 linkat: fix invalid definition of LINKAT_SYMLINK_NOTSUP on OS X diff --git a/m4/mgetgroups.m4 b/m4/mgetgroups.m4 --- a/m4/mgetgroups.m4 +++ b/m4/mgetgroups.m4 @@ -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_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 @@ #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 @@ #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.])