net: do not unlink unix socket in UnixListener created from fd

Fixes #11826.

Change-Id: Id220dd558ca8d8d78c01975087122d27757deea0
Reviewed-on: https://go-review.googlesource.com/17458
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2015-12-05 01:15:26 -05:00
parent f939ee13ae
commit a4fd325c17
2 changed files with 6 additions and 5 deletions

View file

@ -91,7 +91,7 @@ func fileListener(f *os.File) (Listener, error) {
case *TCPAddr:
return &TCPListener{fd}, nil
case *UnixAddr:
return &UnixListener{fd, laddr.Name}, nil
return &UnixListener{fd: fd, path: laddr.Name, unlink: false}, nil
}
fd.Close()
return nil, syscall.EINVAL