From 884c1416b302e9d855453d8e83cc09e54796a434 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 22 Sep 2020 01:12:33 +0200 Subject: 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. --- seatd/seatd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'seatd/seatd.c') diff --git a/seatd/seatd.c b/seatd/seatd.c index bcd73b2..b601bce 100644 --- a/seatd/seatd.c +++ b/seatd/seatd.c @@ -17,7 +17,7 @@ #define LISTEN_BACKLOG 16 -static int open_socket(char *path, int uid, int gid) { +static int open_socket(const char *path, int uid, int gid) { union { struct sockaddr_un unix; struct sockaddr generic; @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { int c; int uid = 0, gid = 0; - char *socket_path = getenv("SEATD_SOCK"); + const char *socket_path = getenv("SEATD_SOCK"); while ((c = getopt(argc, argv, "vhs:g:u:")) != -1) { switch (c) { case 's': @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) { } if (socket_path == NULL) { - socket_path = "/run/seatd.sock"; + socket_path = SEATD_DEFAULTPATH; struct stat st; if (stat(socket_path, &st) == 0) { log_info("removing leftover seatd socket"); -- cgit v1.2.3