#include <common/shm.hpp>
#include <common/utils.hpp>
+#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
/*
* Creates the application socket.
*/
-static int create_application_socket(void)
+static int create_application_socket()
{
int ret = 0;
int apps_sock;
/* See shm.c for this call implying mmap, shm and futex calls */
wait_shm_mmap = shm_ust_get_mmap(the_config.wait_shm_path.value, is_root);
- if (wait_shm_mmap == NULL) {
+ if (wait_shm_mmap == nullptr) {
goto error;
}
* Gets allocated in this thread, enqueued to a global queue, dequeued
* and freed in the manage apps thread.
*/
- struct ust_command *ust_cmd = NULL;
+ struct ust_command *ust_cmd = nullptr;
const bool is_root = (getuid() == 0);
struct thread_state *thread_state = (struct thread_state *) data;
const int application_socket = thread_state->application_socket;
goto error_poll_add;
}
- while (1) {
+ while (true) {
DBG("Accepting application registration");
/* Inifinite blocking call, waiting for transmission */
/* Create UST registration command for enqueuing */
ust_cmd = zmalloc<ust_command>();
- if (ust_cmd == NULL) {
+ if (ust_cmd == nullptr) {
PERROR("ust command zmalloc");
ret = close(sock);
if (ret) {
ERR("Health error occurred in %s", __func__);
}
health_unregister(the_health_sessiond);
- return NULL;
+ return nullptr;
}
static bool shutdown_application_registration_thread(void *data)
{
int ret;
struct lttng_pipe *quit_pipe;
- struct thread_state *thread_state = NULL;
- struct lttng_thread *thread = NULL;
+ struct thread_state *thread_state = nullptr;
+ struct lttng_thread *thread = nullptr;
const bool is_root = (getuid() == 0);
int application_socket = -1;
*/
application_socket = -1;
if (!wait_thread_status(thread_state)) {
- thread_state = NULL;
+ thread_state = nullptr;
goto error;
}
}
}
error_alloc:
- return NULL;
+ return nullptr;
}