Fix: hang in thread_rotation when using compat-poll
authorYannick Lamarre <ylamarre@efficios.com>
Thu, 25 Apr 2019 22:23:31 +0000 (18:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 4 May 2019 19:27:46 +0000 (15:27 -0400)
Add missing verification to prevent a blocking read on an empty fd.

Signed-off-by: Yannick Lamarre <ylamarre@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/rotation-thread.c

index 6669372dd471210470138dbab6605907fa15019d..b86b166892ad917fff5ba7f40366d0aa9bd08bc0 100644 (file)
@@ -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);
 
This page took 0.026131 seconds and 4 git commands to generate.