Fix: grab more than one packet for snapshots
[lttng-tools.git] / src / bin / lttng-sessiond / agent-thread.c
index 2c018e9c686050263651f9c7ec54552ef45b536c..4c1457fe0df7a6fed32ce8141a1474e4cc2d531e 100644 (file)
@@ -306,12 +306,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 +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.042781 seconds and 4 git commands to generate.