Fix: compat poll: add missing empty revents checks
[lttng-tools.git] / src / bin / lttng-sessiond / agent-thread.c
index 1caf748432a4ec1918cab71a87b4788e02da1e47..a9cc6e735ae0ec4097d7a3a72df4793e06d7bc41 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <assert.h>
 
 #include <common/common.h>
@@ -60,10 +61,12 @@ static void update_agent_app(struct agent_app *app)
                if (session->ust_session) {
                        struct agent *agt;
 
+                       rcu_read_lock();
                        agt = trace_ust_find_agent(session->ust_session, app->domain);
                        if (agt) {
                                agent_update(agt, app->sock->fd);
                        }
+                       rcu_read_unlock();
                }
                session_unlock(session);
        }
@@ -327,6 +330,11 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
+                       if (!revents) {
+                               /* No activity for this FD (poll implementation). */
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = sessiond_check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
This page took 0.023784 seconds and 4 git commands to generate.