summaryrefslogtreecommitdiff
path: root/server_config.go
diff options
context:
space:
mode:
Diffstat (limited to 'server_config.go')
-rw-r--r--server_config.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/server_config.go b/server_config.go
index ecd7dd2b..b927c8c6 100644
--- a/server_config.go
+++ b/server_config.go
@@ -5,6 +5,7 @@ import (
"net"
"os/exec"
"strings"
+ "syscall"
"time"
)
@@ -51,6 +52,10 @@ func (cfg *ServerConfig) makeFactory() (Factory, error) {
return nil, errors.New("invalid relay DSN (pipes, tcp://:6001, unix://rr.sock)")
}
+ if dsn[0] == "unix" {
+ syscall.Unlink(dsn[1])
+ }
+
ln, err := net.Listen(dsn[0], dsn[1])
if err != nil {
return nil, err