Skip to content

Commit c833fcd

Browse files
committed
Revert "Replace syscall.Unlink with os.Remove so that the directory(e.g. /run/docker.sock/) can be deleted"
This reverts commit e37f6db. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent fcb221c commit c833fcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sockets/unix_socket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func WithChmod(mask os.FileMode) SockOption {
7979

8080
// NewUnixSocketWithOpts creates a unix socket with the specified options
8181
func NewUnixSocketWithOpts(path string, opts ...SockOption) (net.Listener, error) {
82-
if err := os.Remove(path); err != nil && !os.IsNotExist(err) {
82+
if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) {
8383
return nil, err
8484
}
8585
mask := syscall.Umask(0777)

0 commit comments

Comments
 (0)