mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: only remove Unix domain socket file on the first call to Close
Fixes #17131. Change-Id: I60b381687746fadce12ef18a190cbe3f435172f2 Reviewed-on: https://go-review.googlesource.com/32098 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Quentin Smith <quentin@golang.org>
This commit is contained in:
parent
87e48c5afd
commit
13558c41ff
3 changed files with 23 additions and 6 deletions
|
|
@ -7,6 +7,7 @@ package net
|
|||
import (
|
||||
"context"
|
||||
"os"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -206,9 +207,10 @@ func DialUnix(net string, laddr, raddr *UnixAddr) (*UnixConn, error) {
|
|||
// typically use variables of type Listener instead of assuming Unix
|
||||
// domain sockets.
|
||||
type UnixListener struct {
|
||||
fd *netFD
|
||||
path string
|
||||
unlink bool
|
||||
fd *netFD
|
||||
path string
|
||||
unlink bool
|
||||
unlinkOnce sync.Once
|
||||
}
|
||||
|
||||
func (ln *UnixListener) ok() bool { return ln != nil && ln.fd != nil }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue