X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=2e5ec5c35de08459d0b77b2d224f14ae90632bb3;hp=80dedd5c6cfd057397eef3706ec62ef9717889e7;hb=88f2b785b937a5c2af4e21e925b6242ea6c8362b;hpb=2d85a600590b23ca5ca1e182187d08f44808ef80 diff --git a/src/common/consumer.c b/src/common/consumer.c index 80dedd5c6..2e5ec5c35 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -491,8 +491,15 @@ int lttng_consumer_poll_socket(struct pollfd *consumer_sockpoll) { 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; } @@ -897,10 +904,17 @@ void *lttng_consumer_thread_poll_fds(void *data) 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;