Skip to content

Commit 09f4792

Browse files
authored
Merge pull request #73 from thaJeztah/revert_os_remove
Revert "Replace syscall.Unlink with os.Remove so that the directory(eg. /run/docker.sock/) can be deleted"
2 parents fcb221c + c833fcd commit 09f4792

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sockets/unix_socket.go

Lines changed: 1 addition & 1 deletion
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)