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

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Aug 5 15:06:55 EDT 2013


* Julien Desfossez (jdesfossez at efficios.com) wrote:
> 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).

Merging an updated patch instead:

commit 56591bac20c0f3b728c95d92702d243de838bdc4
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Mon Aug 5 13:46:58 2013 -0400

    Fix: kernel ctl error codes are based on errno
    
    ioctl returns -1, and error codes are based on -errno.
    
    Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

Thanks,

Mathieu

> 
> 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
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list