main: remove stale socket, if it exists

This commit is contained in:
Lars Karlitski 2019-09-14 08:44:52 +02:00
parent dd3b837d8d
commit a63a408c06

View file

@ -12,6 +12,11 @@ import (
)
func main() {
err := os.Remove("/run/weldr/api.socket")
if err != nil && !os.IsNotExist(err) {
panic(err)
}
listener, err := net.Listen("unix", "/run/weldr/api.socket")
if err != nil {
panic(err)