From c59827334cdd9e2e25ae3b75d73045d1fca3fa69 Mon Sep 17 00:00:00 2001
From: Konstantin Tokarev <ktokarev@smartlabs.tv>
Date: Tue, 1 Dec 2015 21:54:03 +0300
Subject: [PATCH] Allow setting syslog identifier via startsyslog().

---
 dbutil.c   | 4 ++--
 dbutil.h   | 2 +-
 svr-main.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dbutil.c b/dbutil.c
index d87835b5..7c7c0690 100644
--- a/dbutil.c
+++ b/dbutil.c
@@ -84,9 +84,9 @@ int debug_trace = 0;
 #endif
 
 #ifndef DISABLE_SYSLOG
-void startsyslog() {
+void startsyslog(const char *ident) {
 
-	openlog(PROGNAME, LOG_PID, LOG_AUTHPRIV);
+	openlog(ident, LOG_PID, LOG_AUTHPRIV);
 
 }
 #endif /* DISABLE_SYSLOG */
diff --git a/dbutil.h b/dbutil.h
index e1db3280..098563d6 100644
--- a/dbutil.h
+++ b/dbutil.h
@@ -31,7 +31,7 @@
 #include "queue.h"
 
 #ifndef DISABLE_SYSLOG
-void startsyslog();
+void startsyslog(const char *ident);
 #endif
 
 #ifdef __GNUC__
diff --git a/svr-main.c b/svr-main.c
index 8bd1a78d..af56a7c4 100644
--- a/svr-main.c
+++ b/svr-main.c
@@ -367,8 +367,8 @@ static void commonsetup() {
 
 	struct sigaction sa_chld;
 #ifndef DISABLE_SYSLOG
-		startsyslog();
 	if (opts.usingsyslog) {
+		startsyslog(PROGNAME);
 	}
 #endif
 
-- 
GitLab