The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1683
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === It is not necessary to unlink the abstract socket pathname when we have finished using the socket. The abstract name is automatically removed when the socket is closed. Signed-off-by: Long Wang <w...@laoqinren.net>
From 42c6141c5a3d1ee0800a5659770159ab3055d46e Mon Sep 17 00:00:00 2001 From: Long Wang <w...@laoqinren.net> Date: Sat, 8 Jul 2017 10:29:57 +0800 Subject: [PATCH] af_unix: remove unlink operation It is not necessary to unlink the abstract socket pathname when we have finished using the socket. The abstract name is automatically removed when the socket is closed. Signed-off-by: Long Wang <w...@laoqinren.net> --- src/lxc/af_unix.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c index 074fabb44..be7f6ce59 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -42,9 +42,6 @@ int lxc_abstract_unix_open(const char *path, int type, int flags) size_t len; struct sockaddr_un addr; - if (flags & O_TRUNC) - unlink(path); - fd = socket(PF_UNIX, type, 0); if (fd < 0) return -1; @@ -86,13 +83,6 @@ int lxc_abstract_unix_open(const char *path, int type, int flags) int lxc_abstract_unix_close(int fd) { - struct sockaddr_un addr; - socklen_t addrlen = sizeof(addr); - - if (!getsockname(fd, (struct sockaddr *)&addr, &addrlen) && - addr.sun_path[0]) - unlink(addr.sun_path); - close(fd); return 0;
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel