summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-23 17:50:57 +0300
committerWolfy-J <[email protected]>2018-06-23 17:50:57 +0300
commit8f9b2ba00d704a4de1a0750960abad6b0ded0011 (patch)
tree579b5870bb6e5c00d50452d3a9e2a4ff87f7decc /service
parent930528c2e524bdc49ef02be9dd9ed89a9d8cb201 (diff)
clean up unix sockets
Diffstat (limited to 'service')
-rw-r--r--service/rpc/config.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/rpc/config.go b/service/rpc/config.go
index 06d63d65..e3168945 100644
--- a/service/rpc/config.go
+++ b/service/rpc/config.go
@@ -4,6 +4,7 @@ import (
"errors"
"net"
"strings"
+ "syscall"
)
type config struct {
@@ -21,6 +22,10 @@ func (cfg *config) listener() (net.Listener, error) {
return nil, errors.New("invalid socket DSN (tcp://:6001, unix://rpc.sock)")
}
+ if dsn[0] == "unix" {
+ syscall.Unlink(dsn[1])
+ }
+
return net.Listen(dsn[0], dsn[1])
}