0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-01 02:27:49 +08:00

return POLLERR from polling on POSIX sockets (linux version)

This commit is contained in:
Martin Sustrik 2010-03-01 17:40:39 +01:00
parent 7442f53956
commit 4e7158b67d

View File

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