projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sessiond: ODR violation results in memory corruption
[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 5bcc637b0f5c18be82d5ef217f58309e991ffa24..f6aaef623f23369328ec1fc61b1748b12ed177e0 100644
(file)
--- a/
src/bin/lttng-sessiond/register.cpp
+++ b/
src/bin/lttng-sessiond/register.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2011
David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011
EfficiOS Inc.
* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
@@
-10,20
+10,21
@@
#include <stddef.h>
#include <stdlib.h>
#include <urcu.h>
#include <stddef.h>
#include <stdlib.h>
#include <urcu.h>
-#include <common/futex.h>
-#include <common/macros.h>
-#include <common/shm.h>
-#include <common/utils.h>
+#include <common/futex.h
pp
>
+#include <common/macros.h
pp
>
+#include <common/shm.h
pp
>
+#include <common/utils.h
pp
>
#include <sys/stat.h>
#include <sys/stat.h>
-#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.h
pp
"
+#include "lttng-sessiond.h
pp
"
+#include "testpoint.h
pp
"
+#include "health-sessiond.h
pp
"
+#include "fd-limit.h
pp
"
+#include "utils.h
pp
"
+#include "thread.h
pp
"
+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.
@@
-265,7
+267,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
+394,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.025333 seconds
and
4
git commands to generate.