#include <unistd.h>
#include <assert.h>
#include <inttypes.h>
+#include <fcntl.h>
#define CLIENT_POLL_MASK_IN (LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP)
#define CLIENT_POLL_MASK_IN_OUT (CLIENT_POLL_MASK_IN | LPOLLOUT)
hash ^= hash_key_str(condition->session_name, lttng_ht_seed);
}
if (condition->channel_name) {
- hash ^= hash_key_str(condition->session_name, lttng_ht_seed);
+ hash ^= hash_key_str(condition->channel_name, lttng_ht_seed);
}
if (condition->domain.set) {
hash ^= hash_key_ulong(
&iter);
node = cds_lfht_iter_get_node(&iter);
if (!node) {
+ free(client_list_element);
goto end_unlock;
}
return ret;
}
+static
int handle_notification_thread_command_unregister_trigger(
struct notification_thread_state *state,
struct lttng_trigger *trigger,
}
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:
DBG("[notification-thread] Added new notification channel client socket (%i) to poll set",
client->socket);
- /* Add to ht. */
rcu_read_lock();
cds_lfht_add(state->client_socket_ht,
hash_client_socket(client->socket),
handshake_client =
(struct lttng_notification_channel_command_handshake *)
client->communication.inbound.buffer.data;
- client->major = handshake_client->major;
+ client->major = handshake_client->major;
client->minor = handshake_client->minor;
if (!client->communication.inbound.creds_received) {
ERR("[notification-thread] No credentials received from client");
* 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);