Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-03-20 11:53:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2003-03-20 11:53:28 +0300
commitfa85038b5fd57316f5482d633f2ad015ded02713 (patch)
tree405bc2d334189c9790b3f0dbf066da3e5d20391c
parent4da34970dea1656ccc686491a988452533a3ce77 (diff)
* fhandler_socket.cc (fhandler_socket::sendto): Restrict EPIPE and
SIGPIPE handling to connection oriented sockets. Add comment.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_socket.cc9
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d79fd7588..f2b5123f8 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-20 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::sendto): Restrict EPIPE and
+ SIGPIPE handling to connection oriented sockets. Add comment.
+
2003-03-19 Christopher Faylor <cgf@redhat.com>
* sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 7617bc23b..a665c6cc5 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -1058,8 +1058,13 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
else
res = ret;
- /* Special handling for SIGPIPE */
- if (res == -1 && get_errno () == ESHUTDOWN)
+ /* Special handling for EPIPE and SIGPIPE.
+
+ EPIPE is generated if the local end has been shut down on a connection
+ oriented socket. In this case the process will also receive a SIGPIPE
+ unless MSG_NOSIGNAL is set. */
+ if (res == -1 && get_errno () == ESHUTDOWN
+ && get_socket_type () == SOCK_STREAM)
{
set_errno (EPIPE);
if (! (flags & MSG_NOSIGNAL))