[CRIU] Re: [PATCH] restore: close opened fd

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 20 08:29:19 EST 2012


On Mon, Feb 20, 2012 at 04:18:42PM +0300, Kinsbursky Stanislav wrote:
> This is a cleanup patch. It adds some close() calls where required and
> replaces close() with closer_safe().
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
> ---
>  
...
>  		pr_info("%d: Restoring shared page: %16lx\n", pid, va);
>  		write(fd, &va, sizeof(va));
> -		sendfile(fd, pgfd, NULL, PAGE_SIZE);
> +		sendfile(fd, shmfd, NULL, PAGE_SIZE);
>  	}
>  

We can add ret = 0 here and drop (ret < 0) at runction return
I think, no?

Other than that looks good to me, thanks Stas! I presume it fixes
problem with dangling opened log file on restore?

	Cyrill


More information about the CRIU mailing list