summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-12-07 17:28:43 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-12-07 17:28:43 +0100
commit82012667cca5249ba7aa16ac5880b86ac54f3e98 (patch)
treef3de452bf248bea79137bfabce2622a2ac6c0167
parent9f495942736bfc1c1ef5f0b23d5a1bdab56d3757 (diff)
Deadlock on zmq_close
-rw-r--r--src/fd_signaler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fd_signaler.cpp b/src/fd_signaler.cpp
index 79696a3..a10872d 100644
--- a/src/fd_signaler.cpp
+++ b/src/fd_signaler.cpp
@@ -78,10 +78,13 @@ uint64_t zmq::fd_signaler_t::poll ()
ssize_t sz;
while (true) {
sz = read (fd, &signals, sizeof (uint64_t));
- if (sz == 0 || (errno != EAGAIN && errno != EINTR))
- break;
+ if (sz == -1) {
+ if (errno == EAGAIN || errno == EINTR)
+ continue;
+ zmq_assert (false);
+ }
+ break;
}
- errno_assert (sz != -1);
// Set to non-blocking mode.
rc = fcntl (fd, F_SETFL, flags | O_NONBLOCK);