From 68d95e66b395ef94f30936fb45b9f86028876ca2 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 4 Aug 2020 01:44:27 +0200 Subject: seatd: Unlink default seatd socket on startup --- seatd/seatd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/seatd/seatd.c b/seatd/seatd.c index d0ff7e1..7cc7c71 100644 --- a/seatd/seatd.c +++ b/seatd/seatd.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "client.h" @@ -37,6 +38,11 @@ int main(int argc, char *argv[]) { char *path = getenv("SEATD_SOCK"); if (path == NULL) { path = "/run/seatd.sock"; + struct stat st; + if (stat(path, &st) == 0) { + log_info("removing leftover seatd socket"); + unlink(path); + } } if (server_listen(&server, path) == -1) { -- cgit v1.2.3