[lttng-dev] [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on metadata stream

Julien Desfossez jdesfossez at efficios.com
Mon Aug 5 11:27:18 EDT 2013


On error, the ioctl kernctl_get_next_subbuf returns -1 and sets errno to
a meaningful value but we were ignoring it. It was causing
lttng_kconsumer_read_subbuffer to return -1 (error) instead of -EAGAIN
(normal).

Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
 src/common/kernel-consumer/kernel-consumer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index 3086abe..f8978d2 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
@@ -851,7 +851,7 @@ ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
 	/* Get the next subbuffer */
 	err = kernctl_get_next_subbuf(infd);
 	if (err != 0) {
-		ret = err;
+		ret = -errno;
 		/*
 		 * This is a debug message even for single-threaded consumer,
 		 * because poll() have more relaxed criterions than get subbuf,
-- 
1.7.10.4




More information about the lttng-dev mailing list