Fix: add missing pthread_join in sessiond
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 41cdf112687c86fc60af8d832b07684dfc4c49bd..cf15ff9b02a4aec563614c699ec161f221f270ee 100644 (file)
@@ -3985,6 +3985,9 @@ int main(int argc, char **argv)
        health_init(&ustconsumer64_data.health);
        health_poll_update(&ustconsumer64_data.health);
 
+       /* Not needed anymore. */
+       free(rundir);
+
        /* Create thread to manage the client socket */
        ret = pthread_create(&health_thread, NULL,
                        thread_manage_health, (void *) NULL);
@@ -4073,7 +4076,25 @@ exit_dispatch:
                goto error;     /* join error, exit without cleanup */
        }
 
+       ret = join_consumer_thread(&ustconsumer32_data);
+       if (ret != 0) {
+               PERROR("join_consumer ust32");
+               goto error;     /* join error, exit without cleanup */
+       }
+
+       ret = join_consumer_thread(&ustconsumer64_data);
+       if (ret != 0) {
+               PERROR("join_consumer ust64");
+               goto error;     /* join error, exit without cleanup */
+       }
+
 exit_client:
+       ret = pthread_join(health_thread, &status);
+       if (ret != 0) {
+               PERROR("pthread_join health thread");
+               goto error;     /* join error, exit without cleanup */
+       }
+
 exit_health:
 exit:
        /*
This page took 0.0274 seconds and 5 git commands to generate.