From d4a41067d3e873ba4a87c4711ad2f755e7de9157 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 2 Nov 2010 14:27:24 +0100 Subject: HP-UX has no OPEN_MAX defined devpoll_t used this constant to determine how many events to retrieve from the poller in one go. The implementation was changed not to depend on this constant. Signed-off-by: Martin Sustrik --- src/devpoll.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/devpoll.cpp') diff --git a/src/devpoll.cpp b/src/devpoll.cpp index 67fed84..3cddecc 100644 --- a/src/devpoll.cpp +++ b/src/devpoll.cpp @@ -136,10 +136,6 @@ void zmq::devpoll_t::stop () void zmq::devpoll_t::loop () { - // According to the poll(7d) man page, we can retrieve - // no more then (OPEN_MAX - 1) events. - int nfds = std::min ((int) max_io_events, OPEN_MAX - 1); - while (!stopping) { struct pollfd ev_buf [max_io_events]; @@ -153,8 +149,13 @@ void zmq::devpoll_t::loop () int timeout = (int) execute_timers (); // Wait for events. + // On Solaris, we can retrieve no more then (OPEN_MAX - 1) events. poll_req.dp_fds = &ev_buf [0]; - poll_req.dp_nfds = nfds; +#if defined ZMQ_HAVE_SOLRIS + poll_req.dp_nfds = std::min ((int) max_io_events, OPEN_MAX - 1); +#else + poll_req.dp_nfds = max_io_events; +#endif poll_req.dp_timeout = timeout ? timeout : -1; int n = ioctl (devpoll_fd, DP_POLL, &poll_req); if (n == -1 && errno == EINTR) -- cgit v1.2.3