Fix: Remove unused argument in debug statement
[lttng-tools.git] / src / bin / lttng-sessiond / agent-thread.c
index 2c018e9c686050263651f9c7ec54552ef45b536c..33cb387c906dd744a12aa8dff554fb2dfda13ab8 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <assert.h>
 
 #include <common/common.h>
@@ -306,12 +307,13 @@ void *agent_thread_manage_registration(void *data)
        }
 
        while (1) {
-               DBG3("[agent-thread] Manage agent polling on %d fds",
-                               LTTNG_POLL_GETNB(&events));
+               DBG3("[agent-thread] Manage agent polling");
 
                /* Inifinite blocking call, waiting for transmission */
 restart:
                ret = lttng_poll_wait(&events, -1);
+               DBG3("[agent-thread] Manage agent return from poll on %d fds",
+                               LTTNG_POLL_GETNB(&events));
                if (ret < 0) {
                        /*
                         * Restart interrupted system call.
@@ -329,6 +331,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.023718 seconds and 4 git commands to generate.