X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=27c870f3ad83fdd546b821f2758c1041d7e8fa95;hb=b64403e3e8962444b688fa369338f47c86003b21;hp=242b05b3d6bb9c65939ea72a900a84fa74d382b7;hpb=e316aad5fbbe3782872083cb68dfdd58bccea811;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 242b05b3d..27c870f3a 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1888,12 +1888,15 @@ restart: lttng_ustconsumer_on_stream_hangup(stream); /* We just flushed the stream now read it. */ - len = ctx->on_buffer_ready(stream, ctx); - /* It's ok to have an unavailable sub-buffer */ - if (len < 0 && len != -EAGAIN) { - rcu_read_unlock(); - goto end; - } + do { + len = ctx->on_buffer_ready(stream, ctx); + /* + * We don't check the return value here since if we get + * a negative len, it means an error occured thus we + * simply remove it from the poll set and free the + * stream. + */ + } while (len > 0); } lttng_poll_del(&events, stream->wait_fd); @@ -1909,7 +1912,7 @@ restart: len = ctx->on_buffer_ready(stream, ctx); /* It's ok to have an unavailable sub-buffer */ - if (len < 0 && len != -EAGAIN) { + if (len < 0 && len != -EAGAIN && len != -ENODATA) { rcu_read_unlock(); goto end; } else if (len > 0) { @@ -2059,7 +2062,7 @@ void *lttng_consumer_thread_poll_fds(void *data) high_prio = 1; len = ctx->on_buffer_ready(local_stream[i], ctx); /* it's ok to have an unavailable sub-buffer */ - if (len < 0 && len != -EAGAIN) { + if (len < 0 && len != -EAGAIN && len != -ENODATA) { goto end; } else if (len > 0) { local_stream[i]->data_read = 1; @@ -2082,7 +2085,7 @@ void *lttng_consumer_thread_poll_fds(void *data) DBG("Normal read on fd %d", pollfd[i].fd); len = ctx->on_buffer_ready(local_stream[i], ctx); /* it's ok to have an unavailable sub-buffer */ - if (len < 0 && len != -EAGAIN) { + if (len < 0 && len != -EAGAIN && len != -ENODATA) { goto end; } else if (len > 0) { local_stream[i]->data_read = 1;