#define _GNU_SOURCE
#include <assert.h>
-#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <stdlib.h>
{
int num_rdy;
+restart:
num_rdy = poll(consumer_sockpoll, 2, -1);
if (num_rdy == -1) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
perror("Poll error");
goto exit;
}
if (orig_offset < stream->chan->max_sb_size) {
return;
}
- sync_file_range(outfd, orig_offset - stream->chan->max_sb_size,
+ lttng_sync_file_range(outfd, orig_offset - stream->chan->max_sb_size,
stream->chan->max_sb_size,
SYNC_FILE_RANGE_WAIT_BEFORE
| SYNC_FILE_RANGE_WRITE
ERR("Unknown consumer_data type");
assert(0);
}
+
+ return 0;
}
/*
pthread_mutex_unlock(&consumer_data.lock);
/* poll on the array of fds */
+ restart:
DBG("polling on %d fd", nb_fd + 1);
num_rdy = poll(pollfd, nb_fd + 1, consumer_poll_timeout);
DBG("poll num_rdy : %d", num_rdy);
if (num_rdy == -1) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
perror("Poll error");
lttng_consumer_send_error(ctx, CONSUMERD_POLL_ERROR);
goto end;