X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.c;h=b0657a4c5675dde9d0d86d1478afbeaedf26646a;hp=00a2bf66f559f1d5b8d6ee2c019e3dd0c2241534;hb=8ada111f6d3ab40d1c33cf1a7b2546de9a47d1d5;hpb=8f56701fa4b73a75378e88a84b0500e18b51ff49 diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 00a2bf66f..b0657a4c5 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -40,6 +40,7 @@ #include #include #include +#include #define CLIENT_POLL_MASK_IN (LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP) #define CLIENT_POLL_MASK_IN_OUT (CLIENT_POLL_MASK_IN | LPOLLOUT) @@ -405,6 +406,7 @@ int notification_thread_client_subscribe(struct notification_client *client, &iter); node = cds_lfht_iter_get_node(&iter); if (!node) { + free(client_list_element); goto end_unlock; } @@ -956,6 +958,7 @@ error: return ret; } +static int handle_notification_thread_command_unregister_trigger( struct notification_thread_state *state, struct lttng_trigger *trigger, @@ -1107,12 +1110,12 @@ int handle_notification_thread_command( } end: cds_list_del(&cmd->cmd_list_node); - futex_nto1_wake(&cmd->reply_futex); + lttng_waiter_wake_up(&cmd->reply_waiter); pthread_mutex_unlock(&handle->cmd_queue.lock); return ret; error_unlock: /* Wake-up and return a fatal error to the calling thread. */ - futex_nto1_wake(&cmd->reply_futex); + lttng_waiter_wake_up(&cmd->reply_waiter); pthread_mutex_unlock(&handle->cmd_queue.lock); cmd->reply_code = LTTNG_ERR_FATAL; error: @@ -1948,9 +1951,7 @@ int handle_notification_thread_channel_sample( * The monitoring pipe only holds messages smaller than PIPE_BUF, * ensuring that read/write of sampling messages are atomic. */ - do { - ret = read(pipe, &sample_msg, sizeof(sample_msg)); - } while (ret == -1 && errno == EINTR); + ret = lttng_read(pipe, &sample_msg, sizeof(sample_msg)); if (ret != sizeof(sample_msg)) { ERR("[notification-thread] Failed to read from monitoring pipe (fd = %i)", pipe);