diff options
author | Martin Hurton <hurtonm@gmail.com> | 2012-05-27 23:26:14 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-05-31 09:38:00 +0200 |
commit | fdd20b81515427dfd461de61c1e6ad6499d7b13e (patch) | |
tree | 3f2d8dcb730a6b2b0e7d5c49cc6d28bedc5cc748 /src | |
parent | 5fc741a911664c1b4e0c7044ee6607cdcfa7182b (diff) |
Don't assume SOCKET_ERROR is -1 on Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/stream_engine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 || |