about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-25 08:22:02 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-25 08:22:02 +0000
commit5e3114974a1982e53f368a09387d0dad1aad1ec1 (patch)
treea9907082e5f162262c528c85140791025a659746
parent0a45b76c6238f4685c07ba5c5db371ae9b95d661 (diff)
downloadglibc-5e3114974a1982e53f368a09387d0dad1aad1ec1.tar.gz
glibc-5e3114974a1982e53f368a09387d0dad1aad1ec1.tar.xz
glibc-5e3114974a1982e53f368a09387d0dad1aad1ec1.zip
Update.
2001-03-25  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): getgroups32
	syscall checks for negative n so don't test here as well.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/i386/getgroups.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f0b51d649a..bbaa5cfade 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-25  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): getgroups32
+	syscall checks for negative n so don't test here as well.
+
 2001-03-23  Jes Sorensen  <jes@linuxcare.com>
 
 	* sysdeps/unix/sysv/linux/ia64/sysdep.h (ENTRY): Moved to ...
diff --git a/sysdeps/unix/sysv/linux/i386/getgroups.c b/sysdeps/unix/sysv/linux/i386/getgroups.c
index 2efe341e0d..45d8fd0495 100644
--- a/sysdeps/unix/sysv/linux/i386/getgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/getgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -45,16 +45,16 @@ extern int __libc_missing_32bit_uids;
 int
 __getgroups (int n, gid_t *groups)
 {
-  if (n < 0)
+#if __ASSUME_32BITUIDS > 0
+  return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
+#else
+  if (__builtin_expect (n, 1) < 0)
     {
       __set_errno (EINVAL);
       return -1;
     }
   else
     {
-#if __ASSUME_32BITUIDS > 0
-      return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
-#else
       int i, ngids;
       __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
 # ifdef __NR_getgroups32
@@ -77,8 +77,8 @@ __getgroups (int n, gid_t *groups)
 	for (i = 0; i < ngids; i++)
 	  (__ptrvalue (groups))[i] = kernel_groups[i];
       return ngids;
-#endif
     }
+#endif
 }
 
 weak_alias (__getgroups, getgroups)