From mboxrd@z Thu Jan 1 00:00:00 1970 From: ylamarre@efficios.com (Yannick Lamarre) Date: Thu, 25 Apr 2019 10:36:17 -0400 Subject: [lttng-dev] [PATCH lttng-tools v5 5/8] Fix hang in thread_rotation when using compat-poll In-Reply-To: <20190425143620.3348-1-ylamarre@efficios.com> References: <20190425143620.3348-1-ylamarre@efficios.com> Message-ID: <20190425143620.3348-6-ylamarre@efficios.com> Add missing verification to prevent a blocking read on an empty fd. Signed-off-by: Yannick Lamarre --- src/bin/lttng-sessiond/rotation-thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 6669372d..b86b1668 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); -- 2.11.0