Skip to content

Commit 27a83db

Browse files
Kirill TkhaiCyrill Gorcunov
authored andcommitted
unix: Do pr_perror() before cleanup
revert_unix_sk_cwd() may rewrite errno, so call pr_perror() firstly. Signed-off-by: Kirill Tkhai <[email protected]> Signed-off-by: Andrei Vagin <[email protected]>
1 parent 1cb90e1 commit 27a83db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

criu/sk-unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,8 @@ static int post_open_unix_sk(struct file_desc *d, int fd)
977977
if (connect(fd, (struct sockaddr *)&addr,
978978
sizeof(addr.sun_family) +
979979
peer->ue->name.len) < 0) {
980-
revert_unix_sk_cwd(&cwd_fd, &root_fd);
981980
pr_perror("Can't connect %#x socket", ui->ue->ino);
981+
revert_unix_sk_cwd(&cwd_fd, &root_fd);
982982
return -1;
983983
}
984984

0 commit comments

Comments
 (0)