lttng_poll_reset(&events);
/* Poll infinite value of time */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
} else if (ret == 0) {
/* Should not happen since timeout is infinite */
nb_fd = LTTNG_POLL_GETNB(&events);
/* Inifinite blocking call, waiting for transmission */
+restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
nb_fd = LTTNG_POLL_GETNB(&events);
/* Inifinite blocking call, waiting for transmission */
+restart_poll:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart_poll;
+ }
goto error;
}
DBG("Apps thread polling on %d fds", nb_fd);
/* Inifinite blocking call, waiting for transmission */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
nb_fd = LTTNG_POLL_GETNB(&events);
/* Inifinite blocking call, waiting for transmission */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
nb_fd = LTTNG_POLL_GETNB(&events);
/* Inifinite blocking call, waiting for transmission */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
{
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;
}
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;