>From 3722df12ad7d5f13dc8bf2cf0ddc329f0541fb86 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Jun 2015 19:12:07 -0700 Subject: [PATCH] mgetgroups: fix port to strict OS X * m4/mgetgroups.m4 (gl_MGETGROUPS): Use more-sensitive -Werror setting if available. --- ChangeLog | 11 +++++++++++ m4/mgetgroups.m4 | 17 +++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 465bf0e..cb6ca08 100644 --- 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 index 5f19d4f..5747148 100644 --- 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_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.]) -- 2.1.0