[lttng-tools,v4,5/8] Fix hang in thread_rotationwhen using compat-poll
Commit Message
Add missing verification to prevent a blocking read on an empty fd.
Signed-off-by: Yannick Lamarre <ylamarre at efficios.com>
---
src/bin/lttng-sessiond/rotation-thread.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -974,6 +974,10 @@ void *thread_rotation(void *data)
int fd = LTTNG_POLL_GETFD(&thread.events, i);
uint32_t revents = LTTNG_POLL_GETEV(&thread.events, i);
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
DBG("[rotation-thread] Handling fd (%i) activity (%u)",
fd, revents);