Fix: call lttng_poll_set_max_size before start threads
[lttng-tools.git] / src / bin / lttng-relayd / live.c
index fd570e0fc4bd801ebe065e5fd32b2f1c7780323f..3728005df77c3efa3d7c9e20f5ca537db26940bf 100644 (file)
@@ -488,6 +488,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 = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -1922,6 +1927,11 @@ restart:
 
                        health_code_update();
 
+                       if (!revents) {
+                               /* No activity for this FD (poll implementation). */
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -2092,7 +2102,10 @@ int relayd_live_create(struct lttng_uri *uri,
        cds_wfcq_init(&viewer_conn_queue.head, &viewer_conn_queue.tail);
 
        /* Set up max poll set size */
-       lttng_poll_set_max_size();
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_init_data;
+       }
 
        /* Setup the dispatcher thread */
        ret = pthread_create(&live_dispatcher_thread, NULL,
This page took 0.033985 seconds and 5 git commands to generate.