[lxc-devel] [lxc/master] lxc_abstract_unix_connect: remove the workaround-code

0x0916 on Github lxc-bot at linuxcontainers.org
Sat Jul 8 02:57:56 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 483 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170708/bc50355c/attachment.bin>
-------------- next part --------------
From b34cf53b7dcdc4a3952e8167e807016476cecabf Mon Sep 17 00:00:00 2001
From: Long Wang <w at laoqinren.net>
Date: Sat, 8 Jul 2017 10:48:15 +0800
Subject: [PATCH] lxc_abstract_unix_connect: remove the workaround-code

commit bdb3f44147bc1a55a97131b4b39d42844ae4fb9e says that we may undo
the change in august 2014.

I think that it is time to do that.

Signed-off-by: Long Wang <w at laoqinren.net>
---
 src/lxc/af_unix.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c
index 074fabb44..e6ba81fb8 100644
--- a/src/lxc/af_unix.c
+++ b/src/lxc/af_unix.c
@@ -123,12 +123,7 @@ int lxc_abstract_unix_connect(const char *path)
 	strncpy(&addr.sun_path[1], &path[1], strlen(&path[1]));
 
 	if (connect(fd, (struct sockaddr *)&addr, offsetof(struct sockaddr_un, sun_path) + len + 1)) {
-		int tmp = errno;
-		/* special case to connect to older containers */
-		if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == 0)
-			return fd;
 		close(fd);
-		errno = tmp;
 		return -1;
 	}
 


More information about the lxc-devel mailing list