in case of WSAESHUTDOWN.
(fhandler_socket::recvmsg): Ditto.
* poll.cc (poll): Set revents to POLLIN instead of POLLHUP. Add comment.
+2005-11-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * 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.
+
2005-11-11 Christopher Faylor <cgf@timesys.com>
* cygheap.h (init_cygheap::_gtod): Remove.
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
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
else
fds[i].revents |= POLLIN;
break;
- case 0: /* Closed on the read side. */
- fds[i].revents |= POLLHUP;
+ case 0: /* Closed on the read side... */
+ /* ...or shutdown(SHUT_WR) on the write side.
+ We set revents to POLLHUP until 1.5.18, but
+ this is semantically borderline. */
+ fds[i].revents |= POLLIN;
break;
default:
fds[i].revents |= POLLIN;