Fix: ignore SIGPIPE
[lttng-tools.git] / src / bin / lttng-consumerd / lttng-consumerd.c
index 00660fcd6a7d401aa3096236026eabd1900d5f64..1373a74b28212d5595d8c4f0dc18a89938e6a616 100644 (file)
@@ -99,14 +99,6 @@ static void sighandler(int sig)
                return;
        }
 
-       /*
-        * Ignore SIGPIPE because it should not stop the consumer whenever a
-        * SIGPIPE is caught through a FD operation.
-        */
-       if (sig == SIGPIPE) {
-               return;
-       }
-
        if (ctx) {
                lttng_consumer_should_exit(ctx);
        }
@@ -127,9 +119,10 @@ static int set_signal_handler(void)
                return ret;
        }
 
-       sa.sa_handler = sighandler;
        sa.sa_mask = sigset;
        sa.sa_flags = 0;
+
+       sa.sa_handler = sighandler;
        if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
                PERROR("sigaction");
                return ret;
@@ -140,6 +133,7 @@ static int set_signal_handler(void)
                return ret;
        }
 
+       sa.sa_handler = SIG_IGN;
        if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
                PERROR("sigaction");
                return ret;
@@ -362,12 +356,6 @@ int main(int argc, char **argv)
                goto exit_health_consumerd_cleanup;
        }
 
-       /* Set up max poll set size */
-       if (lttng_poll_set_max_size()) {
-               retval = -1;
-               goto exit_init_data;
-       }
-
        if (*command_sock_path == '\0') {
                switch (opt_type) {
                case LTTNG_CONSUMER_KERNEL:
@@ -498,7 +486,7 @@ int main(int argc, char **argv)
        }
 
        /* Create thread to manage the client socket */
-       ret = pthread_create(&health_thread, NULL,
+       ret = pthread_create(&health_thread, default_pthread_attr(),
                        thread_manage_health, (void *) NULL);
        if (ret) {
                errno = ret;
@@ -517,7 +505,7 @@ int main(int argc, char **argv)
        cmm_smp_mb();   /* Read ready before following operations */
 
        /* Create thread to manage channels */
-       ret = pthread_create(&channel_thread, NULL,
+       ret = pthread_create(&channel_thread, default_pthread_attr(),
                        consumer_thread_channel_poll,
                        (void *) ctx);
        if (ret) {
@@ -528,7 +516,7 @@ int main(int argc, char **argv)
        }
 
        /* Create thread to manage the polling/writing of trace metadata */
-       ret = pthread_create(&metadata_thread, NULL,
+       ret = pthread_create(&metadata_thread, default_pthread_attr(),
                        consumer_thread_metadata_poll,
                        (void *) ctx);
        if (ret) {
@@ -539,8 +527,8 @@ int main(int argc, char **argv)
        }
 
        /* Create thread to manage the polling/writing of trace data */
-       ret = pthread_create(&data_thread, NULL, consumer_thread_data_poll,
-                       (void *) ctx);
+       ret = pthread_create(&data_thread, default_pthread_attr(),
+                       consumer_thread_data_poll, (void *) ctx);
        if (ret) {
                errno = ret;
                PERROR("pthread_create");
@@ -549,7 +537,7 @@ int main(int argc, char **argv)
        }
 
        /* Create the thread to manage the receive of fd */
-       ret = pthread_create(&sessiond_thread, NULL,
+       ret = pthread_create(&sessiond_thread, default_pthread_attr(),
                        consumer_thread_sessiond_poll,
                        (void *) ctx);
        if (ret) {
@@ -563,7 +551,7 @@ int main(int argc, char **argv)
         * Create the thread to manage the UST metadata periodic timer and
         * live timer.
         */
-       ret = pthread_create(&metadata_timer_thread, NULL,
+       ret = pthread_create(&metadata_timer_thread, default_pthread_attr(),
                        consumer_timer_thread, (void *) ctx);
        if (ret) {
                errno = ret;
This page took 0.024711 seconds and 4 git commands to generate.