Deadlock on zmq_close

This commit is contained in:
Martin Sustrik 2009-12-07 17:28:43 +01:00
parent 9f49594273
commit 82012667cc

View File

@ -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);