Commit 7668e797 authored by Martin Sustrik's avatar Martin Sustrik

zmq_poll returns ETERM in case of context termination

parent 3236cb1a
...@@ -117,9 +117,6 @@ The requested socket 'type' is invalid. ...@@ -117,9 +117,6 @@ The requested socket 'type' is invalid.
The number of application threads using sockets within this 'context' has been The number of application threads using sockets within this 'context' has been
exceeded. See the 'app_threads' parameter of the _zmq_init()_ function. exceeded. See the 'app_threads' parameter of the _zmq_init()_ function.
*ETERM*::
The associated context was terminted.
SEE ALSO SEE ALSO
-------- --------
......
...@@ -408,7 +408,11 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) ...@@ -408,7 +408,11 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
// Process 0MQ commands if needed. // Process 0MQ commands if needed.
if (nsockets && pollfds [npollfds -1].revents & POLLIN) if (nsockets && pollfds [npollfds -1].revents & POLLIN)
app_thread->process_commands (false, false); if (!app_thread->process_commands (false, false)) {
free (pollfds);
errno = ETERM;
return -1;
}
// Check for the events. // Check for the events.
int pollfd_pos = 0; int pollfd_pos = 0;
...@@ -560,7 +564,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) ...@@ -560,7 +564,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
// Process 0MQ commands if needed. // Process 0MQ commands if needed.
if (nsockets && FD_ISSET (notify_fd, &inset)) if (nsockets && FD_ISSET (notify_fd, &inset))
app_thread->process_commands (false, false); if (!app_thread->process_commands (false, false)) {
errno = ETERM;
return -1;
}
// Check for the events. // Check for the events.
for (int i = 0; i != nitems_; i++) { for (int i = 0; i != nitems_; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment