* fhandler_socket.cc (fhandler_socket::send_internal): Fix setting

nosignal flag.  Convert ECONNABORTED on connection-oriented socket
	to EPIPE, too.
This commit is contained in:
Corinna Vinschen 2011-08-23 13:07:24 +00:00
parent 1c5c40f638
commit 247caa48ea
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2011-08-23 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::send_internal): Fix setting
nosignal flag. Convert ECONNABORTED on connection-oriented socket
to EPIPE, too.
2011-08-21 Christopher Faylor <me.cygwin2011@cgf.cx>
* dtable.cc (conv_start_chars): Remove unneeded section attribute.

View File

@ -1585,7 +1585,7 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags)
WSABUF buf;
bool use_sendmsg = false;
DWORD wait_flags = flags & MSG_DONTWAIT;
bool nosignal = !(flags & MSG_NOSIGNAL);
bool nosignal = !!(flags & MSG_NOSIGNAL);
flags &= (MSG_OOB | MSG_DONTROUTE);
if (wsamsg->Control.len > 0)
@ -1648,7 +1648,8 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags)
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 (get_errno () == ESHUTDOWN && get_socket_type () == SOCK_STREAM)
if ((get_errno () == ECONNABORTED || get_errno () == ESHUTDOWN)
&& get_socket_type () == SOCK_STREAM)
{
set_errno (EPIPE);
if (!nosignal)