diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-03-01 17:40:39 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-03-01 17:40:39 +0100 |
commit | 4e7158b67dcbbc307e76616a85aa34cc83ad6606 (patch) | |
tree | a823c0a4375d436d7545710874216ac2f4d890df /src | |
parent | 7442f53956e5d32d9c6a3543f8bef1664a773926 (diff) |
return POLLERR from polling on POSIX sockets (linux version)
Diffstat (limited to 'src')
-rw-r--r-- | src/zmq.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/zmq.cpp b/src/zmq.cpp index ca9a970..7ff1e52 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -405,9 +405,14 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) // If the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. if (!items_ [i].socket) { - items_ [i].revents = - (pollfds [pollfd_pos].revents & POLLIN ? ZMQ_POLLIN : 0) | - (pollfds [pollfd_pos].revents & POLLOUT ? ZMQ_POLLOUT : 0); + items_ [i].revents = 0; + if (pollfds [pollfd_pos].revents & POLLIN) + items_ [i].revents |= ZMQ_POLLIN; + if (pollfds [pollfd_pos].revents & POLLOUT) + items_ [i].revents |= ZMQ_POLLOUT; + if (pollfds [pollfd_pos].revents & ~(POLLIN | POLLOUT)) + items_ [i].revents |= ZMQ_POLLERR; + if (items_ [i].revents) nevents++; pollfd_pos++; |