Clean-up: sessiond: remove left-over code
[lttng-tools.git] / src / bin / lttng-sessiond / manage-consumer.cpp
index cce48526e681309de3cb17bc0ea111b83abcba54..a3bb816f9459457ab0a1a74379bab796283a228b 100644 (file)
@@ -9,22 +9,24 @@
 
 #include <signal.h>
 
-#include <common/pipe.h>
-#include <common/utils.h>
+#include <common/pipe.hpp>
+#include <common/utils.hpp>
 
-#include "manage-consumer.h"
-#include "testpoint.h"
-#include "health-sessiond.h"
-#include "utils.h"
-#include "thread.h"
-#include "ust-consumer.h"
+#include "manage-consumer.hpp"
+#include "testpoint.hpp"
+#include "health-sessiond.hpp"
+#include "utils.hpp"
+#include "thread.hpp"
+#include "ust-consumer.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        struct consumer_data *consumer_data;
        sem_t ready;
        int initialization_result;
 };
+} /* namespace */
 
 static void mark_thread_as_ready(struct thread_notifiers *notifiers)
 {
@@ -193,7 +195,7 @@ static void *thread_consumer_management(void *data)
        consumer_data->metadata_sock.fd_ptr = &consumer_data->metadata_fd;
 
        /* Create metadata socket lock. */
-       consumer_data->metadata_sock.lock = (pthread_mutex_t *) zmalloc(sizeof(pthread_mutex_t));
+       consumer_data->metadata_sock.lock = zmalloc<pthread_mutex_t>();
        if (consumer_data->metadata_sock.lock == NULL) {
                PERROR("zmalloc pthread mutex");
                mark_thread_intialization_as_failed(notifiers);
@@ -437,7 +439,7 @@ bool launch_consumer_management_thread(struct consumer_data *consumer_data)
        struct thread_notifiers *notifiers = NULL;
        struct lttng_thread *thread;
 
-       notifiers = (thread_notifiers *) zmalloc(sizeof(*notifiers));
+       notifiers = zmalloc<thread_notifiers>();
        if (!notifiers) {
                goto error_alloc;
        }
This page took 0.023491 seconds and 4 git commands to generate.