From a009702cd6ae5954d666869a1861ecb7e59bc2b5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 12 May 2010 13:08:45 +0200 Subject: Fixed Windows build warnings. --- libssh/poll.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libssh/poll.c') diff --git a/libssh/poll.c b/libssh/poll.c index d37d15bf..879d3647 100644 --- a/libssh/poll.c +++ b/libssh/poll.c @@ -65,7 +65,6 @@ int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { #else /* HAVE_POLL */ -#include #include #ifdef _WIN32 @@ -73,11 +72,13 @@ int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { #define STRICT #endif +#include #include #else #include #include #include +#include #endif static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { @@ -150,9 +151,15 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { char data[64] = {0}; /* support for POLLHUP */ +#ifdef _WIN32 + if ((recv(fds[i].fd, data, 64, MSG_PEEK) == -1) && + (errno == WSAESHUTDOWN || errno == WSAECONNRESET || + errno == WSAECONNABORTED || errno == WSAENETRESET)) { +#else if ((recv(fds[i].fd, data, 64, MSG_PEEK) == -1) && (errno == ESHUTDOWN || errno == ECONNRESET || errno == ECONNABORTED || errno == ENETRESET)) { +#endif fds[i].revents |= POLLHUP; } else { fds[i].revents |= fds[i].events & (POLLIN | POLLRDNORM); -- cgit