aboutsummaryrefslogtreecommitdiff
path: root/seatd
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-09-22 01:12:33 +0200
committerKenny Levinsen <kl@kl.wtf>2020-09-22 01:14:20 +0200
commit884c1416b302e9d855453d8e83cc09e54796a434 (patch)
treeaeee0f56dff75586588ecb67d2ce34305714e244 /seatd
parenta763e16f26529323cd23a84a53f8d03431133d91 (diff)
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.
Diffstat (limited to 'seatd')
-rw-r--r--seatd/seatd.c6
1 files changed, 3 insertions, 3 deletions
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");