[lttng-dev] [PATCH lttng-tools] Fix: Dead code when checking return value from (ust_app|kernel)_snapshot_record

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Aug 5 15:12:39 EDT 2013


merged, thanks!

Mathieu

* Christian Babeux (christian.babeux at efficios.com) wrote:
> Signed-off-by: Christian Babeux <christian.babeux at efficios.com>
> ---
>  src/bin/lttng-sessiond/cmd.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
> index 84594ad..e9fa3b4 100644
> --- a/src/bin/lttng-sessiond/cmd.c
> +++ b/src/bin/lttng-sessiond/cmd.c
> @@ -2590,10 +2590,12 @@ static int record_kernel_snapshot(struct ltt_kernel_session *ksess,
>  
>  	ret = kernel_snapshot_record(ksess, output, wait, nb_streams);
>  	if (ret < 0) {
> -		ret = LTTNG_ERR_SNAPSHOT_FAIL;
>  		if (ret == -EINVAL) {
>  			ret = LTTNG_ERR_INVALID;
> +			goto error_snapshot;
>  		}
> +
> +		ret = LTTNG_ERR_SNAPSHOT_FAIL;
>  		goto error_snapshot;
>  	}
>  
> @@ -2646,10 +2648,12 @@ static int record_ust_snapshot(struct ltt_ust_session *usess,
>  
>  	ret = ust_app_snapshot_record(usess, output, wait, nb_streams);
>  	if (ret < 0) {
> -		ret = LTTNG_ERR_SNAPSHOT_FAIL;
>  		if (ret == -EINVAL) {
>  			ret = LTTNG_ERR_INVALID;
> +			goto error_snapshot;
>  		}
> +
> +		ret = LTTNG_ERR_SNAPSHOT_FAIL;
>  		goto error_snapshot;
>  	}
>  
> -- 
> 1.8.3.3
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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



More information about the lttng-dev mailing list