mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 08:46:44 +01:00
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
This commit is contained in:
commit
ca176121de
@ -42,13 +42,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* 0MQ versioning support. */
|
||||
/* 0MQ versioning support. */
|
||||
/******************************************************************************/
|
||||
|
||||
ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
|
||||
|
||||
/******************************************************************************/
|
||||
// 0MQ errors.
|
||||
/* 0MQ errors. */
|
||||
/******************************************************************************/
|
||||
|
||||
/* A number random anough not to collide with different errno ranges on */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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++) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user