}
/* Add thread quit pipe to monitored events. */
- const auto poll_add_ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);
+ const auto poll_add_ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN);
if (poll_add_ret < 0) {
return -1;
}
goto error_poll_create;
}
- ret = lttng_poll_add(&events, thread_quit_pipe_fd,
- LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
goto error_tcp_socket;
}
mark_thread_as_ready(notifiers);
/* Add TCP socket to the poll set. */
- ret = lttng_poll_add(&events, reg_sock->fd,
- LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(&events, reg_sock->fd, LPOLLIN | LPOLLRDHUP);
if (ret < 0) {
goto error;
}
* read), only add poll error event to only
* detect shutdown.
*/
- ret = lttng_poll_add(&events, new_app_socket_fd,
- LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(&events, new_app_socket_fd, LPOLLRDHUP);
if (ret < 0) {
agent_destroy_app(new_app);
continue;
}
/* Add thread quit pipe */
- ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
goto error;
}
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;
}
goto error;
}
- ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
goto error;
}
goto error;
}
- ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
goto error;
}
* Since this is a command socket (write then read),
* we only monitor the error events of the socket.
*/
- ret = lttng_poll_add(&events, sock,
- LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(&events, sock, LPOLLRDHUP);
if (ret < 0) {
goto error;
}
goto error_poll;
}
- ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
mark_thread_intialization_as_failed(notifiers);
goto error;
#include "lttng-sessiond.hpp"
#include "kernel.hpp"
-#define CLIENT_POLL_EVENTS_IN (LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP)
+#define CLIENT_POLL_EVENTS_IN (LPOLLIN | LPOLLRDHUP)
#define CLIENT_POLL_EVENTS_IN_OUT (CLIENT_POLL_EVENTS_IN | LPOLLOUT)
/* The tracers currently limit the capture size to PIPE_BUF (4kb on linux). */
lttng_domain_type_str(domain_type));
/* Adding the read side pipe to the event poll. */
- ret = lttng_poll_add(&state->events, tracer_event_source_fd, LPOLLPRI | LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&state->events, tracer_event_source_fd, LPOLLPRI | LPOLLIN);
if (ret < 0) {
ERR("Failed to add tracer event source to poll set: tracer_event_source_fd = %d, domain = '%s'",
tracer_event_source_fd,
goto end;
}
- ret = lttng_poll_add(poll_set, notification_channel_socket,
- LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(poll_set, notification_channel_socket, LPOLLIN | LPOLLRDHUP);
if (ret < 0) {
ERR("Failed to add notification channel socket to pollset");
goto error;
}
- ret = lttng_poll_add(poll_set, handle->cmd_queue.event_fd,
- LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(poll_set, handle->cmd_queue.event_fd, LPOLLIN);
if (ret < 0) {
ERR("Failed to add notification command queue event fd to pollset");
goto error;
}
ret = lttng_poll_add(poll_set,
- handle->channel_monitoring_pipes.ust32_consumer,
- LPOLLIN | LPOLLERR);
+ handle->channel_monitoring_pipes.ust32_consumer, LPOLLIN);
if (ret < 0) {
ERR("Failed to add ust-32 channel monitoring pipe fd to pollset");
goto error;
}
ret = lttng_poll_add(poll_set,
- handle->channel_monitoring_pipes.ust64_consumer,
- LPOLLIN | LPOLLERR);
+ handle->channel_monitoring_pipes.ust64_consumer, LPOLLIN);
if (ret < 0) {
ERR("Failed to add ust-64 channel monitoring pipe fd to pollset");
goto error;
goto end;
}
ret = lttng_poll_add(poll_set,
- handle->channel_monitoring_pipes.kernel_consumer,
- LPOLLIN | LPOLLERR);
+ handle->channel_monitoring_pipes.kernel_consumer, LPOLLIN);
if (ret < 0) {
ERR("Failed to add kernel channel monitoring pipe fd to pollset");
goto error;
/* Add notify pipe to the pollset. */
ret = lttng_poll_add(&events, notifiers->apps_cmd_notify_pipe_read_fd,
- LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ LPOLLIN | LPOLLRDHUP);
if (ret < 0) {
goto error;
}
- ret = lttng_poll_add(&events, thread_quit_pipe_fd,
- LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN);
if (ret < 0) {
goto error;
}
}
health_code_update();
- ret = lttng_poll_add(&events, sock,
- LPOLLIN | LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(&events, sock, LPOLLIN | LPOLLRDHUP);
if (ret < 0) {
/*
* It's possible we've reached the max poll fd allowed.
}
ret = lttng_poll_add(poll_set,
- lttng_pipe_get_readfd(handle->quit_pipe),
- LPOLLIN | LPOLLERR);
+ lttng_pipe_get_readfd(handle->quit_pipe), LPOLLIN);
if (ret < 0) {
ERR("Failed to add quit pipe read fd to poll set");
goto error;
ret = lttng_poll_add(poll_set,
lttng_pipe_get_readfd(handle->rotation_timer_queue->event_pipe),
- LPOLLIN | LPOLLERR);
+ LPOLLIN);
if (ret < 0) {
ERR("Failed to add rotate_pending fd to poll set");
goto error;
goto end;
}
ret = lttng_poll_add(&state->events, rotate_notification_channel->socket,
- LPOLLIN | LPOLLERR);
+ LPOLLIN);
if (ret < 0) {
ERR("Failed to add notification fd to pollset");
goto end;
ret = -1;
goto end;
}
- ret = lttng_poll_add(&events, main_quit_pipe[0], LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, main_quit_pipe[0], LPOLLIN);
if (ret < 0) {
PERROR("Failed to add file descriptor to poll/epoll set");
ret = -1;
}
/* Add main quit pipe */
- ret = lttng_poll_add(events, main_quit_pipe[0], LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(events, main_quit_pipe[0], LPOLLIN);
if (ret < 0) {
goto error;
}
stream->wait_fd);
/* Add metadata stream to the global poll events list */
- lttng_poll_add(&events, stream->wait_fd,
- LPOLLIN | LPOLLPRI | LPOLLHUP);
- } else if (revents & (LPOLLERR | LPOLLHUP)) {
+ lttng_poll_add(&events, stream->wait_fd, LPOLLIN | LPOLLPRI);
+ }else if (revents & (LPOLLERR | LPOLLHUP)) {
DBG("Metadata thread pipe hung up");
/*
* Remove the pipe from the poll set and continue the loop
&chan->wait_fd_node);
rcu_read_unlock();
/* Add channel to the global poll events list */
- lttng_poll_add(&events, chan->wait_fd,
- LPOLLERR | LPOLLHUP);
+ // FIXME: Empty flag on a pipe pollset, this might hang on FreeBSD.
+ lttng_poll_add(&events, chan->wait_fd, 0);
break;
case CONSUMER_CHANNEL_DEL:
{
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
goto end_unlock;
}
- ret = lttng_poll_add(&events, channel->socket, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, channel->socket, LPOLLIN);
if (ret < 0) {
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
goto end_clean_poll;
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
goto end_unlock;
}
- ret = lttng_poll_add(&events, channel->socket, LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(&events, channel->socket, LPOLLIN);
if (ret < 0) {
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
goto end_clean_poll;
}
ret = lttng_poll_add(&handle->communication.events, sessiond_socket,
- LPOLLIN | LPOLLHUP | LPOLLRDHUP | LPOLLERR);
+ LPOLLIN | LPOLLRDHUP);
if (ret) {
goto error;
}
}
ret = lttng_poll_add(&handle->communication.events, sessiond_socket,
- LPOLLIN | LPOLLHUP | LPOLLRDHUP | LPOLLERR);
+ LPOLLIN | LPOLLRDHUP);
if (ret) {
goto error;
}
childok(lttng_poll_create(&cpoll_events, 1, 0) == 0, "Create valid poll set succeeds");
childok(lttng_poll_mod(NULL, infd[0], LPOLLIN) == -1, "lttng_poll_mod with invalid input returns an error");
childok(lttng_poll_mod(&cpoll_events, infd[0], LPOLLIN) == -1, "lttng_poll_mod with invalid input returns an error");
- childok(lttng_poll_add(&cpoll_events, infd[0], LPOLLHUP) == 0, "Add valid FD succeeds");
+ childok(lttng_poll_add(&cpoll_events, infd[0], LPOLLIN) == 0, "Add valid FD succeeds");
childok(lttng_poll_mod(&cpoll_events, -1, LPOLLIN) == -1, "lttng_poll_mod with invalid input returns an error");
childok(lttng_poll_mod(&cpoll_events, hupfd[0], LPOLLIN) == 0, "lttng_poll_mod on unincluded FD goes on");
childok(lttng_poll_mod(&cpoll_events, infd[0], LPOLLIN) == 0, "Modify event type succeeds");
ok(lttng_poll_create(&poll_events, 1, 0) == 0, "Create valid poll set succeeds");
ok(lttng_poll_wait(&poll_events, -1) == -1, "lttng_poll_wait call with invalid input returns error");
- ok(lttng_poll_add(&poll_events, hupfd[0], LPOLLHUP) == 0, "Add valid FD succeeds");
+ ok(lttng_poll_add(&poll_events, hupfd[0], LPOLLIN) == 0, "Add valid FD succeeds");
ok(lttng_write(infd[1], &tbuf, 1) == 1, "Write to pipe succeeds");
ok(lttng_poll_wait(&poll_events, -1) == 1, "Wakes up on one event");
ok(lttng_poll_del(&poll_events, hupfd[0]) == 0, "Removing valid FD succeeds");