seatd: Unlink default seatd socket on startup
This commit is contained in:
parent
55cbe043e2
commit
68d95e66b3
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
@ -37,6 +38,11 @@ int main(int argc, char *argv[]) {
|
||||||
char *path = getenv("SEATD_SOCK");
|
char *path = getenv("SEATD_SOCK");
|
||||||
if (path == NULL) {
|
if (path == NULL) {
|
||||||
path = "/run/seatd.sock";
|
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) {
|
if (server_listen(&server, path) == -1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue