about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-11-20 22:47:14 +0000
committerUlrich Drepper <drepper@redhat.com>2006-11-20 22:47:14 +0000
commit852d657c229b33d7aa2d0a0509459b73e17eacbe (patch)
tree2609ae862ad0cba777ad5ea0307e1217c50c0843
parent36c0a6366543ab894aea9d47410a5c40b44c440e (diff)
downloadglibc-852d657c229b33d7aa2d0a0509459b73e17eacbe.tar.gz
glibc-852d657c229b33d7aa2d0a0509459b73e17eacbe.tar.xz
glibc-852d657c229b33d7aa2d0a0509459b73e17eacbe.zip
* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke
	__sysconf only after having tried to call getgroups32.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/i386/getgroups.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f8f3230863..7eb3ae0d7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-18  Bruno Haible  <bruno@clisp.org>
+
+	* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke
+	__sysconf only after having tried to call getgroups32.
+
 2006-11-19  Ulrich Drepper  <drepper@redhat.com>
 
 	* nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style
diff --git a/sysdeps/unix/sysv/linux/i386/getgroups.c b/sysdeps/unix/sysv/linux/i386/getgroups.c
index b7a0a4efd4..f69baf943b 100644
--- a/sysdeps/unix/sysv/linux/i386/getgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/getgroups.c
@@ -52,8 +52,6 @@ __getgroups (int n, gid_t *groups)
     }
   else
     {
-      int i, ngids;
-      __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
 # ifdef __NR_getgroups32
       if (__libc_missing_32bit_uids <= 0)
 	{
@@ -69,6 +67,9 @@ __getgroups (int n, gid_t *groups)
 	}
 # endif /* __NR_getgroups32 */
 
+      int i, ngids;
+      __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
+
       ngids = INLINE_SYSCALL (getgroups, 2, n, CHECK_N (kernel_groups, n));
       if (n != 0 && ngids > 0)
 	for (i = 0; i < ngids; i++)