meson: Make default seatd socket path configurable

FreeBSD and Linux have different preferred socket locations. Expose an
option to set the location, and implement simple auto-logic for
linux/freebsd.
This commit is contained in:
Kenny Levinsen 2020-09-22 01:12:33 +02:00
parent a763e16f26
commit 884c1416b3
4 changed files with 17 additions and 6 deletions

View file

@ -67,9 +67,9 @@ static int seatd_connect(void) {
close(fd);
return -1;
}
char *path = getenv("SEATD_SOCK");
const char *path = getenv("SEATD_SOCK");
if (path == NULL) {
path = "/run/seatd.sock";
path = SEATD_DEFAULTPATH;
}
addr.unix.sun_family = AF_UNIX;
strncpy(addr.unix.sun_path, path, sizeof addr.unix.sun_path);