[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r739 - in /fsf/trunk/libc: ChangeLog resolv/mapv4v6addr.h sysdeps/unix/sysv/linux/i386/getgroups.c



Author: eglibc
Date: Tue Nov 21 00:02:15 2006
New Revision: 739

Log:
Import glibc-mainline for 2006-11-21

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/resolv/mapv4v6addr.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/getgroups.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Nov 21 00:02:15 2006
@@ -1,3 +1,12 @@
+2006-11-20  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* resolv/mapv4v6addr.h (map_v4v6_address): Optimize a bit.
+
+2006-11-18  Bruno Haible  <bruno@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke
+	__sysconf only after having tried to call getgroups32.
+
 2006-11-19  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style

Modified: fsf/trunk/libc/resolv/mapv4v6addr.h
==============================================================================
--- fsf/trunk/libc/resolv/mapv4v6addr.h (original)
+++ fsf/trunk/libc/resolv/mapv4v6addr.h Tue Nov 21 00:02:15 2006
@@ -56,16 +56,14 @@
 map_v4v6_address (const char *src, char *dst)
 {
   u_char *p = (u_char *) dst;
-  char tmp[INADDRSZ];
   int i;
 
-  /* Stash a temporary copy so our caller can update in place. */
-  memcpy (tmp, src, INADDRSZ);
+  /* Move the IPv4 part to the right position.  */
+  memcpy (src + 12, src, INADDRSZ);
+
   /* Mark this ipv6 addr as a mapped ipv4. */
   for (i = 0; i < 10; i++)
     *p++ = 0x00;
   *p++ = 0xff;
-  *p++ = 0xff;
-  /* Retrieve the saved copy and we're done. */
-  memcpy ((void *) p, tmp, INADDRSZ);
+  *p = 0xff;
 }

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/getgroups.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/getgroups.c Tue Nov 21 00:02:15 2006
@@ -52,8 +52,6 @@
     }
   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 @@
 	}
 # 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++)