#include "lttng-sessiond.hpp"
#include "thread.hpp"
+namespace {
struct thread_notifiers {
struct ust_cmd_queue *ust_cmd_queue;
int apps_cmd_pipe_write_fd;
int apps_cmd_notify_pipe_write_fd;
int dispatch_thread_exit;
};
+} /* namespace */
/*
* For each tracing session, update newly registered apps. The session list
cds_list_for_each_entry_safe(wait_node, tmp_wait_node,
&wait_queue->head, head) {
LTTNG_ASSERT(wait_node->app);
- ret = lttng_poll_add(&events, wait_node->app->sock,
- LPOLLHUP | LPOLLERR);
+ ret = lttng_poll_add(&events, wait_node->app->sock, LPOLLIN);
if (ret < 0) {
goto error;
}
break;
}
- ust_cmd = caa_container_of(node, struct ust_command, node);
+ ust_cmd = lttng::utils::container_of(node, &ust_command::node);
DBG("Dispatching UST registration pid:%d ppid:%d uid:%d"
" gid:%d sock:%d name:%s (version %d.%d)",
ust_cmd->reg_msg.major, ust_cmd->reg_msg.minor);
if (ust_cmd->reg_msg.type == LTTNG_UST_CTL_SOCKET_CMD) {
- wait_node = (ust_reg_wait_node *) zmalloc(sizeof(*wait_node));
+ wait_node = zmalloc<ust_reg_wait_node>();
if (!wait_node) {
PERROR("zmalloc wait_node dispatch");
ret = close(ust_cmd->sock);
if (node == NULL) {
break;
}
- ust_cmd = caa_container_of(node, struct ust_command, node);
+ ust_cmd = lttng::utils::container_of(node, &ust_command::node);
ret = close(ust_cmd->sock);
if (ret < 0) {
PERROR("close ust sock exit dispatch %d", ust_cmd->sock);
struct lttng_thread *thread;
struct thread_notifiers *notifiers;
- notifiers = (thread_notifiers *) zmalloc(sizeof(*notifiers));
+ notifiers = zmalloc<thread_notifiers>();
if (!notifiers) {
goto error;
}