With poll(), we have to iterate over all fd in the pollset since it is
handled in user space where we don't have to with epoll.o
This is a first patch to fix the fact that we should iterate over the
number of fd the lttng_poll_wait() call returns which is for epoll the
number of returned events and with poll the whole set of fd.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
goto error;
}
+ /*
+ * Since the returned events are set sequentially in the "events" structure
+ * we only need to return the epoll_wait value and iterate over it.
+ */
return ret;
error:
goto error;
}
- return ret;
+ /*
+ * poll() should always iterate on all FDs since we handle the pollset in
+ * user space and after poll returns, we have to try every fd for a match.
+ */
+ return events->nb_fd;
error:
return -1;