X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fregister.cpp;h=34efeac40f57729fd0811806e56cb7665847fefc;hb=de5abcb02431896a1827dff5d3376e1f2e124cd7;hp=5bcc637b0f5c18be82d5ef217f58309e991ffa24;hpb=7966af5763c4aaca39df9bbfa9277ff15715c720;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/register.cpp b/src/bin/lttng-sessiond/register.cpp index 5bcc637b0..34efeac40 100644 --- a/src/bin/lttng-sessiond/register.cpp +++ b/src/bin/lttng-sessiond/register.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * Copyright (C) 2011 Mathieu Desnoyers * Copyright (C) 2013 Jérémie Galarneau * @@ -10,20 +10,21 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include "register.h" -#include "lttng-sessiond.h" -#include "testpoint.h" -#include "health-sessiond.h" -#include "fd-limit.h" -#include "utils.h" -#include "thread.h" +#include "register.hpp" +#include "lttng-sessiond.hpp" +#include "testpoint.hpp" +#include "health-sessiond.hpp" +#include "fd-limit.hpp" +#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. @@ -39,7 +41,6 @@ static int create_application_socket(void) { int ret = 0; int apps_sock; - const mode_t old_umask = umask(0); /* Create the application unix socket */ apps_sock = lttcomm_create_unix_sock( @@ -72,7 +73,6 @@ static int create_application_socket(void) DBG3("Session daemon application socket created (fd = %d) ", apps_sock); ret = apps_sock; end: - umask(old_umask); return ret; error_close_socket: if (close(apps_sock)) { @@ -265,7 +265,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 +392,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; }