[CRIU] [PATCH 8/9] unix: fix an error code in bind_unix_sk()

Andrei Vagin avagin at virtuozzo.com
Fri Mar 16 20:24:29 MSK 2018


Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/sk-unix.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 77c7b5606..a4e8c5630 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1328,7 +1328,7 @@ static int bind_unix_sk(int sk, struct unix_sk_info *ui)
 {
 	struct sockaddr_un addr;
 	int cwd_fd = -1, root_fd = -1, ns_fd = -1;
-	int ret = -1;
+	int ret, exit_code = -1;
 
 	if (ui->ue->name.len == 0)
 		return 0;
@@ -1341,8 +1341,7 @@ static int bind_unix_sk(int sk, struct unix_sk_info *ui)
 		 * restored we should walk those temp names and rename
 		 * some of them back to real ones.
 		 */
-		ret = 0;
-		goto done;
+		return 0;
 	}
 
 	memset(&addr, 0, sizeof(addr));
@@ -1397,10 +1396,10 @@ static int bind_unix_sk(int sk, struct unix_sk_info *ui)
 		wake_connected_sockets(ui);
 	}
 
-	ret = 0;
+	exit_code = 0;
 done:
 	revert_unix_sk_cwd(&cwd_fd, &root_fd, &ns_fd);
-	return ret;
+	return exit_code;
 }
 
 static int post_open_interconnected_master(struct unix_sk_info *ui)
-- 
2.13.6



More information about the CRIU mailing list