diff options
author | Martin Lucina <mato@kotelna.sk> | 2010-09-04 16:24:21 +0200 |
---|---|---|
committer | Martin Lucina <mato@kotelna.sk> | 2010-09-04 16:24:21 +0200 |
commit | ca176121deb8dbdc62d8a37fec377c07fc786480 (patch) | |
tree | 6b53af092e5de652a6ba92ba771333901930fa62 /src | |
parent | 2673a84e07b93b8607958516c55341c2eb220a6e (diff) | |
parent | 51a84c15ded2d70985c9d971ebdf3f3c9c18d590 (diff) |
Merge branch 'maint'
* maint:
zmq::select_t, zmq_poll(): assert if FD_SETSIZE reached
zmq.h: Fix typo and use of C99 comment
Conflicts:
src/zmq.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/select.cpp | 4 | ||||
-rw-r--r-- | src/zmq.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/select.cpp b/src/select.cpp index 7345cbb..59eb83e 100644 --- a/src/select.cpp +++ b/src/select.cpp @@ -65,6 +65,10 @@ zmq::select_t::handle_t zmq::select_t::add_fd (fd_t fd_, i_poll_events *events_) fd_entry_t entry = {fd_, events_}; fds.push_back (entry); + // Ensure we do not attempt to select () on more than FD_SETSIZE + // file descriptors. + zmq_assert (fds.size () <= FD_SETSIZE); + // Start polling on errors. FD_SET (fd_, &source_set_err); diff --git a/src/zmq.cpp b/src/zmq.cpp index 6cf230c..736f764 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -491,6 +491,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) zmq::fd_t maxfd = 0; + // Ensure we do not attempt to select () on more than FD_SETSIZE + // file descriptors. + zmq_assert (nitems_ <= FD_SETSIZE); + // Build the fd_sets for passing to select (). for (int i = 0; i != nitems_; i++) { |