[CRIU] Re: [PATCH] dump: Don't shadow the ret code with dump_namespaces

Andrew Vagin avagin at parallels.com
Tue Mar 13 11:07:08 EDT 2012


Ack

On Tue, Mar 13, 2012 at 06:11:46PM +0400, Cyrill Gorcunov wrote:
> cr_dump_tasks does assign ret = -1 by default but
> dump_namespaces does shadow this variable with own
> error code so that if any subsequent calls will fail
> we will not notice the error.
> 
> Reported-by: Andrew Vagin <avagin at openvz.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  cr-dump.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/cr-dump.c b/cr-dump.c
> index 6c71c84..de7310d 100644
> --- a/cr-dump.c
> +++ b/cr-dump.c
> @@ -1420,8 +1420,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
>  		goto err;
>  
>  	if (opts->namespaces_flags) {
> -		ret = dump_namespaces(pid, opts->namespaces_flags);
> -		if (ret < 0)
> +		if (dump_namespaces(pid, opts->namespaces_flags) < 0)
>  			goto err;
>  	}
>  
> -- 
> 1.7.7.6
> 


More information about the CRIU mailing list