From fdd20b81515427dfd461de61c1e6ad6499d7b13e Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Sun, 27 May 2012 23:26:14 +0200 Subject: Don't assume SOCKET_ERROR is -1 on Windows --- src/stream_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 45a6af6..b0f9f20 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -347,7 +347,7 @@ int xs::stream_engine_t::write (const void *data_, size_t size_) return 0; // Signalise peer failure. - if (nbytes == -1 && ( + if (nbytes == SOCKET_ERROR && ( WSAGetLastError () == WSAENETDOWN || WSAGetLastError () == WSAENETRESET || WSAGetLastError () == WSAEHOSTUNREACH || @@ -397,7 +397,7 @@ int xs::stream_engine_t::read (void *data_, size_t size_) return 0; // Connection failure. - if (nbytes == -1 && ( + if (nbytes == SOCKET_ERROR && ( WSAGetLastError () == WSAENETDOWN || WSAGetLastError () == WSAENETRESET || WSAGetLastError () == WSAECONNABORTED || -- cgit v1.2.3