From: Yannick Lamarre Date: Thu, 25 Apr 2019 22:23:31 +0000 (-0400) Subject: Fix: hang in thread_rotation when using compat-poll X-Git-Tag: v2.11.0-rc2~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=625503a481173603b3bef61d3f6de2932380a04d;p=lttng-tools.git Fix: hang in thread_rotation when using compat-poll Add missing verification to prevent a blocking read on an empty fd. Signed-off-by: Yannick Lamarre Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 6669372dd..b86b16689 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -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);