4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-09 02:29:07 +08:00

Cygwin: AF_UNIX: sendmsg: fix errno if socket is shut down

Following Posix and Linux, the errno should be EPIPE, not ESHUTDOWN.
This commit is contained in:
Ken Brown 2020-10-16 17:54:23 -04:00
parent e1beea13e1
commit 95012189c0

View File

@ -2493,7 +2493,11 @@ fhandler_socket_unix::sendmsg (const struct msghdr *msg, int flags)
}
if (saw_shutdown () & _SHUT_SEND)
{
set_errno (ESHUTDOWN);
set_errno (EPIPE);
/* FIXME: Linux calls for SIGPIPE here, but Posix
doesn't. Should we follow Linux? */
if (!(flags & MSG_NOSIGNAL))
raise (SIGPIPE);
__leave;
}
}