From: Mathieu Desnoyers Date: Tue, 16 Jul 2013 00:12:30 +0000 (-0400) Subject: Fix: kernel consumer: data_pending check if endpoint active X-Git-Tag: v2.2.2~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cd8c31d76a7557cc3d1595b0e5d30308b8baa2c5;p=lttng-tools.git Fix: kernel consumer: data_pending check if endpoint active Reviewed-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 06801b9a1..f61506723 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -607,6 +607,11 @@ int lttng_kconsumer_data_pending(struct lttng_consumer_stream *stream) assert(stream); + if (stream->endpoint_status != CONSUMER_ENDPOINT_ACTIVE) { + ret = 0; + goto end; + } + ret = kernctl_get_next_subbuf(stream->wait_fd); if (ret == 0) { /* There is still data so let's put back this subbuffer. */