Fix: Revert of 814b4934e2604a419bcb8eec57c0450dbb47e2c3
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-commands.cpp
index 60095115947e5e8c362415b046e5d6816b5bda56..1de6ff58be3609d1f24690a055cfcfc756709cce 100644 (file)
@@ -7,9 +7,9 @@
 
 #include <lttng/trigger/trigger.h>
 #include <lttng/lttng-error.h>
-#include "notification-thread.h"
-#include "notification-thread-commands.h"
-#include <common/error.h>
+#include "notification-thread.hpp"
+#include "notification-thread-commands.hpp"
+#include <common/error.hpp>
 #include <unistd.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -33,7 +33,7 @@ int run_command_wait(struct notification_thread_handle *handle,
        cds_list_add_tail(&cmd->cmd_list_node,
                        &handle->cmd_queue.list);
        /* Wake-up thread. */
-       ret = lttng_write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe),
+       ret = lttng_write(handle->cmd_queue.event_fd,
                        &notification_counter, sizeof(notification_counter));
        if (ret != sizeof(notification_counter)) {
                PERROR("write to notification thread's queue event fd");
@@ -59,7 +59,7 @@ struct notification_thread_command *notification_thread_command_copy(
 {
        struct notification_thread_command *new_cmd;
 
-       new_cmd = (notification_thread_command *) zmalloc(sizeof(*new_cmd));
+       new_cmd = zmalloc<notification_thread_command>();
        if (!new_cmd) {
                goto end;
        }
@@ -89,7 +89,7 @@ int run_command_no_wait(struct notification_thread_handle *handle,
        cds_list_add_tail(&new_cmd->cmd_list_node,
                        &handle->cmd_queue.list);
        /* Wake-up thread. */
-       ret = lttng_write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe),
+       ret = lttng_write(handle->cmd_queue.event_fd,
                        &notification_counter, sizeof(notification_counter));
        if (ret != sizeof(notification_counter)) {
                PERROR("write to notification thread's queue event fd");
@@ -425,7 +425,7 @@ struct lttng_event_notifier_notification *lttng_event_notifier_notification_crea
        LTTNG_ASSERT(domain != LTTNG_DOMAIN_NONE);
        LTTNG_ASSERT((payload && payload_size) || (!payload && !payload_size));
 
-       notification = (lttng_event_notifier_notification *) zmalloc(sizeof(struct lttng_event_notifier_notification));
+       notification = zmalloc<lttng_event_notifier_notification>();
        if (notification == NULL) {
                ERR("Error allocating notification");
                goto end;
This page took 0.036632 seconds and 4 git commands to generate.