summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-06-21 13:44:44 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-06-21 13:44:44 +0200
commit10a93bb79fd3d4be1b3ffedfa6785564fbcc082b (patch)
treec5bb1fda02d293798d24259013310da90b1e5680
parenta28928fe376f73ef8ca683523102908616445ada (diff)
Unspecified error code from mailbox_t::recv on Win32 fixed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/mailbox.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index 33bc20c..7fdb93e 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -127,8 +127,10 @@ int zmq::mailbox_t::recv (command_t *cmd_, int timeout_)
// Attempt to read an entire command.
int nbytes = ::recv (r, (char*) cmd_, sizeof (command_t), 0);
- if (nbytes == -1 && WSAGetLastError () == WSAEWOULDBLOCK)
+ if (nbytes == -1 && WSAGetLastError () == WSAEWOULDBLOCK) {
+ errno = EAGAIN;
return -1;
+ }
// Sanity check for success.
wsa_assert (nbytes != SOCKET_ERROR);