diff options
author | Wolfy-J <[email protected]> | 2018-06-23 17:50:57 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-23 17:50:57 +0300 |
commit | 8f9b2ba00d704a4de1a0750960abad6b0ded0011 (patch) | |
tree | 579b5870bb6e5c00d50452d3a9e2a4ff87f7decc /service | |
parent | 930528c2e524bdc49ef02be9dd9ed89a9d8cb201 (diff) |
clean up unix sockets
Diffstat (limited to 'service')
-rw-r--r-- | service/rpc/config.go | 5 |
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]) } |