[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r13668 - in /fsf/trunk/libc: ChangeLog NEWS sysdeps/posix/getaddrinfo.c sysdeps/unix/sysv/linux/pathconf.c
- To: commits@xxxxxxxxxx
- Subject: [commits] r13668 - in /fsf/trunk/libc: ChangeLog NEWS sysdeps/posix/getaddrinfo.c sysdeps/unix/sysv/linux/pathconf.c
- From: eglibc@xxxxxxxxxx
- Date: Tue, 03 May 2011 07:03:15 -0000
Author: eglibc
Date: Tue May 3 00:03:13 2011
New Revision: 13668
Log:
Import glibc-mainline for 2011-05-03
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue May 3 00:03:13 2011
@@ -1,3 +1,15 @@
+2011-04-28 Maciej Babinski <mbabinski@xxxxxxxxxx>
+
+ [BZ #12714]
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't bypass
+ gethostbyname4_r when IPv6 results are possible.
+
+2011-05-02 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #12723]
+ * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Implement
+ _PC_PIPE_BUF handling.
+
2011-04-30 Bruno Haible <bruno@xxxxxxxxx>
[BZ #12717]
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Tue May 3 00:03:13 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2011-5-1
+GNU C Library NEWS -- history of user-visible changes. 2011-5-2
Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -19,7 +19,7 @@
* The following bugs are resolved with this release:
11724, 12420, 12445, 12454, 12460, 12469, 12489, 12509, 12510, 12518, 12583,
- 12587, 12597, 12631, 12650, 12653, 12655, 12685, 12717
+ 12587, 12597, 12631, 12650, 12653, 12655, 12685, 12714, 12717, 12723
Version 2.13
Modified: fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/getaddrinfo.c (original)
+++ fsf/trunk/libc/sysdeps/posix/getaddrinfo.c Tue May 3 00:03:13 2011
@@ -510,12 +510,10 @@
int no_more;
int old_res_options;
- /* If we do not have to look for IPv4 and IPv6 together, use
- the simple, old functions. */
- if (req->ai_family == AF_INET
- || (req->ai_family == AF_INET6
- && ((req->ai_flags & AI_V4MAPPED) == 0
- || (req->ai_flags & AI_ALL) == 0)))
+ /* If we do not have to look for IPv6 addresses, use
+ the simple, old functions, which do not support
+ IPv6 scope ids. */
+ if (req->ai_family == AF_INET)
{
int family = req->ai_family;
size_t tmpbuflen = 512;
@@ -525,7 +523,6 @@
struct hostent *h;
int herrno;
- simple_again:
while (1)
{
rc = __gethostbyname2_r (name, family, &th, tmpbuf,
@@ -537,44 +534,30 @@
if (rc == 0)
{
- if (h == NULL)
- {
- if (req->ai_family == AF_INET6
- && (req->ai_flags & AI_V4MAPPED)
- && family == AF_INET6)
- {
- /* Try again, this time looking for IPv4
- addresses. */
- family = AF_INET;
- goto simple_again;
- }
- }
- else
- {
- /* We found data, now convert it into the list. */
- for (int i = 0; h->h_addr_list[i]; ++i)
- {
- if (*pat == NULL)
- {
- *pat = __alloca (sizeof (struct gaih_addrtuple));
- (*pat)->scopeid = 0;
- }
- (*pat)->next = NULL;
- (*pat)->family = req->ai_family;
- if (family == req->ai_family)
- memcpy ((*pat)->addr, h->h_addr_list[i],
- h->h_length);
- else
- {
- uint32_t *addr = (uint32_t *) (*pat)->addr;
- addr[3] = *(uint32_t *) h->h_addr_list[i];
- addr[2] = htonl (0xffff);
- addr[1] = 0;
- addr[0] = 0;
- }
- pat = &((*pat)->next);
- }
- }
+ if (h != NULL)
+ /* We found data, now convert it into the list. */
+ for (int i = 0; h->h_addr_list[i]; ++i)
+ {
+ if (*pat == NULL)
+ {
+ *pat = __alloca (sizeof (struct gaih_addrtuple));
+ (*pat)->scopeid = 0;
+ }
+ (*pat)->next = NULL;
+ (*pat)->family = req->ai_family;
+ if (family == req->ai_family)
+ memcpy ((*pat)->addr, h->h_addr_list[i],
+ h->h_length);
+ else
+ {
+ uint32_t *addr = (uint32_t *) (*pat)->addr;
+ addr[3] = *(uint32_t *) h->h_addr_list[i];
+ addr[2] = htonl (0xffff);
+ addr[1] = 0;
+ addr[0] = 0;
+ }
+ pat = &((*pat)->next);
+ }
}
else
{
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c Tue May 3 00:03:13 2011
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 1991,1995,1996,1998-2003,2008,2010 Free Software Foundation, Inc.
+ Copyright (C) 1991,1995,1996,1998-2003,2008,2010,2011 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
@@ -36,6 +36,8 @@
__pathconf (const char *file, int name)
{
struct statfs fsbuf;
+ int fd;
+ int flags;
switch (name)
{
@@ -50,6 +52,21 @@
case _PC_CHOWN_RESTRICTED:
return __statfs_chown_restricted (__statfs (file, &fsbuf), &fsbuf);
+
+ case _PC_PIPE_BUF:
+ flags = O_RDONLY|O_NONBLOCK|O_NOCTTY;
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+ fd = open_not_cancel_2 (file, flags);
+ if (fd >= 0)
+ {
+ long int r = __fcntl (fd, F_GETPIPE_SZ);
+ close_not_cancel_no_status (fd);
+ if (r > 0)
+ return r;
+ }
+ /* FALLTHROUGH */
default:
return posix_pathconf (file, name);