[CRIU] [PATCH] unix: Do pr_perror() before cleanup
Kirill Tkhai
ktkhai at virtuozzo.com
Tue Mar 28 08:55:44 PDT 2017
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