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

[commits] r6480 - in /fsf/trunk/libc: ./ hurd/ hurd/hurd/ sysdeps/mach/hurd/ sysdeps/unix/bsd/bsd4.4/bits/



Author: eglibc
Date: Thu Jul  3 00:04:11 2008
New Revision: 6480

Log:
Import glibc-mainline for 2008-07-03

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/hurd/fd-read.c
    fsf/trunk/libc/hurd/get-host.c
    fsf/trunk/libc/hurd/hurd/fd.h
    fsf/trunk/libc/sysdeps/mach/hurd/dl-sysdep.c
    fsf/trunk/libc/sysdeps/mach/hurd/recv.c
    fsf/trunk/libc/sysdeps/mach/hurd/recvfrom.c
    fsf/trunk/libc/sysdeps/mach/hurd/recvmsg.c
    fsf/trunk/libc/sysdeps/mach/hurd/send.c
    fsf/trunk/libc/sysdeps/mach/hurd/sendmsg.c
    fsf/trunk/libc/sysdeps/mach/hurd/sendto.c
    fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Jul  3 00:04:11 2008
@@ -1,3 +1,24 @@
+2008-07-01  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
+
+	* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL.
+	* hurd/hurd/fd.h (__hurd_sockfail): Add extern inline function.
+	* sysdeps/mach/hurd/recv.c (__recv): Use __hurd_sockfail instead of
+	__hurd_dfail.
+	* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
+	* sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise.
+	* sysdeps/mach/hurd/send.c (__send): Likewise.
+	* sysdeps/mach/hurd/sendto.c (__sendfrom): Likewise.
+	* sysdeps/mach/hurd/sendmsg.c (__sendmsg): Likewise.
+
+2008-03-04  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
+
+	* sysdeps/mach/hurd/recv.c (__recv): Initialize NPORTS.
+	* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
+	* sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise.
+	* hurd/fd-read.c (_hurd_fd_read): Initialize NREAD.
+	* hurd/get-host.c (_hurd_get_host_config): Likewise.
+	* sysdeps/mach/hurd/dl-sysdep.c (__libc_read): Likewise.
+
 2008-06-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #6657]

Modified: fsf/trunk/libc/hurd/fd-read.c
==============================================================================
--- fsf/trunk/libc/hurd/fd-read.c (original)
+++ fsf/trunk/libc/hurd/fd-read.c Thu Jul  3 00:04:11 2008
@@ -35,6 +35,7 @@
     }
 
   data = buf;
+  nread = *nbytes;
   if (err = HURD_FD_PORT_USE (fd, _hurd_ctty_input (port, ctty, readfd)))
     return err;
 

Modified: fsf/trunk/libc/hurd/get-host.c
==============================================================================
--- fsf/trunk/libc/hurd/get-host.c (original)
+++ fsf/trunk/libc/hurd/get-host.c Thu Jul  3 00:04:11 2008
@@ -51,6 +51,7 @@
     }
 
   data = buf;
+  nread = buflen;
   err = __io_read (config, &data, &nread, -1, buflen);
   if (! err)
     /* Check if there is more in the file we didn't read.  */

Modified: fsf/trunk/libc/hurd/hurd/fd.h
==============================================================================
--- fsf/trunk/libc/hurd/hurd/fd.h (original)
+++ fsf/trunk/libc/hurd/hurd/fd.h Thu Jul  3 00:04:11 2008
@@ -27,6 +27,7 @@
 
 #include <hurd/hurd_types.h>
 #include <hurd/port.h>
+#include <sys/socket.h>
 
 
 /* Structure representing a file descriptor.  */
@@ -179,6 +180,18 @@
   errno = _hurd_fd_error (fd, err);
   return -1;
 }
+
+/* Likewise, but do not raise SIGPIPE on EPIPE if flags contain
+   MSG_NOSIGNAL.  */
+
+_HURD_FD_H_EXTERN_INLINE int
+__hurd_sockfail (int fd, int flags, error_t err)
+{
+  if (!(flags & MSG_NOSIGNAL) || err != EPIPE)
+    err = _hurd_fd_error (fd, err);
+  errno = err;
+  return -1;
+}
 
 /* Set up *FD to have PORT its server port, doing appropriate ctty magic.
    Does no locking or unlocking.  */

Modified: fsf/trunk/libc/sysdeps/mach/hurd/dl-sysdep.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/dl-sysdep.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/dl-sysdep.c Thu Jul  3 00:04:11 2008
@@ -367,6 +367,7 @@
   mach_msg_type_number_t nread;
 
   data = buf;
+  nread = nbytes;
   err = __io_read ((mach_port_t) fd, &data, &nread, -1, nbytes);
   if (err)
     return __hurd_fail (err);

Modified: fsf/trunk/libc/sysdeps/mach/hurd/recv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/recv.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/recv.c Thu Jul  3 00:04:11 2008
@@ -38,7 +38,7 @@
   char *bufp = buf;
   mach_msg_type_number_t nread = n;
   mach_port_t *ports;
-  mach_msg_type_number_t nports;
+  mach_msg_type_number_t nports = 0;
   char *cdata = NULL;
   mach_msg_type_number_t clen = 0;
 
@@ -48,7 +48,7 @@
 					       &cdata, &clen,
 					       &flags,
 					       n)))
-    return __hurd_dfail (fd, err);
+    return __hurd_sockfail (fd, flags, err);
 
   __mach_port_deallocate (__mach_task_self (), addrport);
   __vm_deallocate (__mach_task_self (), (vm_address_t) cdata, clen);

Modified: fsf/trunk/libc/sysdeps/mach/hurd/recvfrom.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/recvfrom.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/recvfrom.c Thu Jul  3 00:04:11 2008
@@ -41,7 +41,7 @@
   char *bufp = buf;
   mach_msg_type_number_t nread = n;
   mach_port_t *ports;
-  mach_msg_type_number_t nports;
+  mach_msg_type_number_t nports = 0;
   char *cdata = NULL;
   mach_msg_type_number_t clen = 0;
   struct sockaddr *addr = addrarg.__sockaddr__;
@@ -52,7 +52,7 @@
 					       &cdata, &clen,
 					       &flags,
 					       n)))
-    return __hurd_dfail (fd, err);
+    return __hurd_sockfail (fd, flags, err);
 
   /* Get address data for the returned address port if requested.  */
   if (addr != NULL)
@@ -74,7 +74,7 @@
       if (err)
 	{
 	  __mach_port_deallocate (__mach_task_self (), addrport);
-	  return __hurd_dfail (fd, err);
+	  return __hurd_sockfail (fd, flags, err);
 	}
       
       if (*addr_len > buflen)

Modified: fsf/trunk/libc/sysdeps/mach/hurd/recvmsg.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/recvmsg.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/recvmsg.c Thu Jul  3 00:04:11 2008
@@ -34,7 +34,7 @@
   char *data = NULL;
   mach_msg_type_number_t len = 0;
   mach_port_t *ports;
-  mach_msg_type_number_t nports;
+  mach_msg_type_number_t nports = 0;
   char *cdata = NULL;
   mach_msg_type_number_t clen = 0;
   size_t amount;
@@ -63,7 +63,7 @@
 					       &ports, &nports,
 					       &cdata, &clen,
 					       &message->msg_flags, amount)))
-    return __hurd_dfail (fd, err);
+    return __hurd_sockfail (fd, flags, err);
 
   if (message->msg_name != NULL)
     {
@@ -84,7 +84,7 @@
       if (err)
 	{
 	  __mach_port_deallocate (__mach_task_self (), aport);
-	  return __hurd_dfail (fd, err);
+	  return __hurd_sockfail (fd, flags, err);
 	}
 
       if (message->msg_namelen > buflen)

Modified: fsf/trunk/libc/sysdeps/mach/hurd/send.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/send.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/send.c Thu Jul  3 00:04:11 2008
@@ -38,7 +38,7 @@
 					   NULL, MACH_MSG_TYPE_COPY_SEND, 0,
 					   NULL, 0, &wrote));
 
-  return err ? __hurd_dfail (fd, err) : wrote;
+  return err ? __hurd_sockfail (fd, flags, err) : wrote;
 }
 libc_hidden_def (__send)
 weak_alias (__send, send)

Modified: fsf/trunk/libc/sysdeps/mach/hurd/sendmsg.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/sendmsg.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/sendmsg.c Thu Jul  3 00:04:11 2008
@@ -149,7 +149,7 @@
   if (dealloc)
     __vm_deallocate (__mach_task_self (), data.addr, len);
 
-  return err ? __hurd_dfail (fd, err) : amount;
+  return err ? __hurd_sockfail (fd, flags, err) : amount;
 }
 
 weak_alias (__libc_sendmsg, sendmsg)

Modified: fsf/trunk/libc/sysdeps/mach/hurd/sendto.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/sendto.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/sendto.c Thu Jul  3 00:04:11 2008
@@ -79,7 +79,7 @@
 			  err;
 			}));
 
-  return err ? __hurd_dfail (fd, err) : wrote;
+  return err ? __hurd_sockfail (fd, flags, err) : wrote;
 }
 
 weak_alias (__sendto, sendto)

Modified: fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h (original)
+++ fsf/trunk/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h Thu Jul  3 00:04:11 2008
@@ -171,8 +171,10 @@
 #define MSG_CTRUNC MSG_CTRUNC
     MSG_WAITALL		= 0x40,	/* Wait for full request or error.  */
 #define MSG_WAITALL MSG_WAITALL
-    MSG_DONTWAIT	= 0x80	/* This message should be nonblocking.  */
+    MSG_DONTWAIT	= 0x80,	/* This message should be nonblocking.  */
 #define MSG_DONTWAIT MSG_DONTWAIT
+    MSG_NOSIGNAL	= 0x0400	/* Do not generate SIGPIPE on EPIPE.  */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
   };