From fe3066f4c287e3357bcce619a62eaba514fec9ad Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 3 Nov 2019 15:52:13 +0100 Subject: [PATCH] Connect to syslogd using SYSLOG_UNIX_PATH variable, if set Signed-off-by: Joachim Nilsson --- src/syslog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/syslog.c b/src/syslog.c index 3af38a4..c7f6a0f 100644 --- a/src/syslog.c +++ b/src/syslog.c @@ -490,7 +490,11 @@ connectlog_r(struct syslog_data *data) #endif .sun_path = _PATH_LOG, }; + char *path; + path = getenv("SYSLOG_UNIX_PATH"); + if (!data->log_sockpath && path) + data->log_sockpath = path; if (data->log_sockpath && !access(data->log_sockpath, W_OK)) strlcpy(sun.sun_path, data->log_sockpath, sizeof(sun.sun_path));