summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-11-13 16:24:40 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-11-13 16:24:40 +0000
commit6ba3f6bb2d088c7b5ffc84a6ed74ad3d525fde37 (patch)
tree3cde8e0e13957e58867864e7e6c979e5c7ea6192 /winsup/cygwin/fhandler_socket.cc
parent5f2790492859fd5d6f61ec9ed95bf89f25c18111 (diff)
downloadcygnal-6ba3f6bb2d088c7b5ffc84a6ed74ad3d525fde37.tar.gz
cygnal-6ba3f6bb2d088c7b5ffc84a6ed74ad3d525fde37.tar.bz2
cygnal-6ba3f6bb2d088c7b5ffc84a6ed74ad3d525fde37.zip
* fhandler_socket.cc (fhandler_socket::recvfrom): Just return 0 (EOF)
in case of WSAESHUTDOWN. (fhandler_socket::recvmsg): Ditto. * poll.cc (poll): Set revents to POLLIN instead of POLLHUP. Add comment.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 79b59ff9b..5ed7d041a 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -1061,6 +1061,11 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
if (WSAGetLastError () == WSAEMSGSIZE)
return len;
+ /* ESHUTDOWN isn't defined for recv in SUSv3. Simply EOF is returned
+ in this case. */
+ if (WSAGetLastError () == WSAESHUTDOWN)
+ return 0;
+
set_winsock_errno ();
}
else
@@ -1142,6 +1147,11 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
if (WSAGetLastError () == WSAEMSGSIZE)
return len;
+ /* ESHUTDOWN isn't defined for recv in SUSv3. Simply EOF is returned
+ in this case. */
+ if (WSAGetLastError () == WSAESHUTDOWN)
+ return 0;
+
set_winsock_errno ();
}
else