/*
- * 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>
*
#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.hpp>
+#include <common/macros.hpp>
+#include <common/shm.hpp>
+#include <common/utils.hpp>
#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.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;
bool running;
int application_socket;
};
+} /* namespace */
/*
* Creates the application socket.
(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);
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;
}