Commit 4ea447b7 by Christian Brauner Committed by GitHub

Merge pull request #1683 from 0x0916/2017-07-08/remove-unlink

af_unix: remove unlink operation
parents 186f27db 42c6141c
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment