[CRIU] Re: [PATCH 1/8] restore: Use %lx for map_files

Pavel Emelyanov xemul at parallels.com
Mon Feb 20 05:01:39 EST 2012


On 02/20/2012 01:56 PM, Cyrill Gorcunov wrote:
> map_files format defined as %lx-%lx in
> kernel and while there should not be a
> problem if it's written in %p-%p, still
> better to be on a safe side and follow
> kernel's notation.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>

ack

> ---
>  cr-restore.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index fb71300..38d8b4f 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -346,8 +346,8 @@ static int shmem_remap(void *old_addr, void *new_addr, unsigned long size)
>  	int fd;
>  	void *ret;
>  
> -	sprintf(path, "/proc/self/map_files/%p-%p",
> -		old_addr, (void *)old_addr + size);
> +	sprintf(path, "/proc/self/map_files/%lx-%lx",
> +		(long)old_addr, (long)old_addr + size);
>  
>  	fd = open(path, O_RDWR);
>  	if (fd < 0) {



More information about the CRIU mailing list