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

Submitted by Andrey Vagin on March 16, 2018, 5:24 p.m.

Details

Message ID 20180316172430.7815-9-avagin@virtuozzo.com
State Accepted
Series "unix: restore sockets in proper mount namespaces"
Commit ebc4bf287245654c5a4cd47811314209ac8debf0
Headers show

Commit Message

Andrey Vagin March 16, 2018, 5:24 p.m.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/sk-unix.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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)