projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: agent port file is o+w when launching as root
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
register.cpp
diff --git
a/src/bin/lttng-sessiond/register.cpp
b/src/bin/lttng-sessiond/register.cpp
index 36a29d86316586487d90851f37fbf1092c5d44aa..34efeac40f57729fd0811806e56cb7665847fefc 100644
(file)
--- a/
src/bin/lttng-sessiond/register.cpp
+++ b/
src/bin/lttng-sessiond/register.cpp
@@
-24,6
+24,7
@@
#include "utils.hpp"
#include "thread.hpp"
#include "utils.hpp"
#include "thread.hpp"
+namespace {
struct thread_state {
struct lttng_pipe *quit_pipe;
struct ust_cmd_queue *ust_cmd_queue;
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;
};
bool running;
int application_socket;
};
+} /* namespace */
/*
* Creates the application socket.
/*
* Creates the application socket.
@@
-39,7
+41,6
@@
static int create_application_socket(void)
{
int ret = 0;
int apps_sock;
{
int ret = 0;
int apps_sock;
- const mode_t old_umask = umask(0);
/* Create the application unix socket */
apps_sock = lttcomm_create_unix_sock(
/* 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:
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)) {
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 */
(void) utils_set_fd_cloexec(sock);
/* Create UST registration command for enqueuing */
- ust_cmd =
(ust_command *) zmalloc(sizeof(struct ust_command)
);
+ ust_cmd =
zmalloc<ust_command>(
);
if (ust_cmd == NULL) {
PERROR("ust command zmalloc");
ret = close(sock);
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;
const bool is_root = (getuid() == 0);
int application_socket = -1;
- thread_state =
(struct thread_state *) zmalloc(sizeof(*thread_state)
);
+ thread_state =
zmalloc<struct thread_state>(
);
if (!thread_state) {
goto error_alloc;
}
if (!thread_state) {
goto error_alloc;
}
This page took
0.023795 seconds
and
4
git commands to generate.