summaryrefslogtreecommitdiff
path: root/service/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'service/rpc')
-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])
}