X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fregister.cpp;h=f6aaef623f23369328ec1fc61b1748b12ed177e0;hb=f149493493fbd8a3efa4748832c03278c96c38ca;hp=36a29d86316586487d90851f37fbf1092c5d44aa;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/register.cpp b/src/bin/lttng-sessiond/register.cpp index 36a29d863..f6aaef623 100644 --- a/src/bin/lttng-sessiond/register.cpp +++ b/src/bin/lttng-sessiond/register.cpp @@ -24,6 +24,7 @@ #include "utils.hpp" #include "thread.hpp" +namespace { struct thread_state { struct lttng_pipe *quit_pipe; struct ust_cmd_queue *ust_cmd_queue; @@ -31,6 +32,7 @@ struct thread_state { bool running; int application_socket; }; +} /* namespace */ /* * Creates the application socket. @@ -265,7 +267,7 @@ static void *thread_application_registration(void *data) (void) utils_set_fd_cloexec(sock); /* Create UST registration command for enqueuing */ - ust_cmd = (ust_command *) zmalloc(sizeof(struct ust_command)); + ust_cmd = zmalloc(); if (ust_cmd == NULL) { PERROR("ust command zmalloc"); ret = close(sock); @@ -392,7 +394,7 @@ struct lttng_thread *launch_application_registration_thread( const bool is_root = (getuid() == 0); int application_socket = -1; - thread_state = (struct thread_state *) zmalloc(sizeof(*thread_state)); + thread_state = zmalloc(); if (!thread_state) { goto error_alloc; }