diff options
Diffstat (limited to 'lib/socket.go')
-rw-r--r-- | lib/socket.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/socket.go b/lib/socket.go index cdf0f737..119ffdad 100644 --- a/lib/socket.go +++ b/lib/socket.go @@ -7,6 +7,7 @@ import ( "log" "net" "net/url" + "os" "path" "strings" "sync/atomic" @@ -23,6 +24,8 @@ type AercServer struct { func StartServer(logger *log.Logger) (*AercServer, error) { sockpath := path.Join(xdg.RuntimeDir(), "aerc.sock") + // remove the socket if it already exists + os.Remove(sockpath) l, err := net.Listen("unix", sockpath) if err != nil { return nil, err |