[CRIU] [PATCH] unix: Do pr_perror() before cleanup

Andrei Vagin avagin at virtuozzo.com
Wed Mar 29 12:39:27 PDT 2017


Applied, thanks

On Tue, Mar 28, 2017 at 06:55:44PM +0300, Kirill Tkhai wrote:
> revert_unix_sk_cwd() may rewrite errno, so call pr_perror() firstly.
> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  criu/sk-unix.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/sk-unix.c b/criu/sk-unix.c
> index c0759dc3..2291fdec 100644
> --- a/criu/sk-unix.c
> +++ b/criu/sk-unix.c
> @@ -958,8 +958,8 @@ static int post_open_unix_sk(struct file_desc *d, int fd)
>  	if (connect(fd, (struct sockaddr *)&addr,
>  				sizeof(addr.sun_family) +
>  				peer->ue->name.len) < 0) {
> -		revert_unix_sk_cwd(&cwd_fd, &root_fd);
>  		pr_perror("Can't connect %#x socket", ui->ue->ino);
> +		revert_unix_sk_cwd(&cwd_fd, &root_fd);
>  		return -1;
>  	}
>  
> 


More information about the CRIU mailing list