[CRIU] Re: [PATCH] parasite: Simplify parasite command copying

Pavel Emelyanov xemul at parallels.com
Thu Oct 11 12:27:08 EDT 2012


On 10/11/2012 05:59 PM, Cyrill Gorcunov wrote:
> No need for memcpy here, it's plain integer value
> which need to be filled.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  parasite-syscall.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/parasite-syscall.c b/parasite-syscall.c
> index 1118ef2..97eef7a 100644
> --- a/parasite-syscall.c
> +++ b/parasite-syscall.c
> @@ -244,7 +244,8 @@ static int parasite_execute_by_pid(unsigned int cmd, struct parasite_ctl *ctl, p
>  		regs = regs_orig;
>  	}
>  
> -	memcpy(ctl->addr_cmd, &cmd, sizeof(cmd));
> +	/* Setup command */
> +	*(unsigned int *)ctl->addr_cmd = cmd;

Better fix the addr_cmd type.

>  	parasite_setup_regs(ctl->parasite_ip, &regs);
>  
> 




More information about the CRIU mailing list