[CRIU] Re: [PATCH 3/8] restore: Simplify prepare_itimers

Pavel Emelyanov xemul at parallels.com
Mon Feb 20 05:03:31 EST 2012


On 02/20/2012 01:56 PM, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>

NAK.

The exact ret of failed call should be reported properly (TODO, yes), not some
intermix of 3 failures.

> ---
>  cr-restore.c |   11 +++--------
>  1 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 8208509..d1eb802 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1582,14 +1582,9 @@ static int prepare_itimers(int pid, struct task_restore_core_args *args)
>  		return fd;
>  
>  	if (read_img_buf(fd, ie, sizeof(ie)) > 0) {
> -		ret = itimer_restore_and_fix("real",
> -				&ie[0], &args->itimers[0]);
> -		if (!ret)
> -			ret = itimer_restore_and_fix("virt",
> -					&ie[1], &args->itimers[1]);
> -		if (!ret)
> -			ret = itimer_restore_and_fix("prof",
> -					&ie[2], &args->itimers[2]);
> +		ret  = itimer_restore_and_fix("real", &ie[0], &args->itimers[0]);
> +		ret |= itimer_restore_and_fix("virt", &ie[1], &args->itimers[1]);
> +		ret |= itimer_restore_and_fix("prof", &ie[2], &args->itimers[2]);
>  	}
>  
>  	close(fd);



More information about the CRIU mailing list