changeset 1211:6ecc133fb2ee

Allow setting syslog identifier via startsyslog().
author Konstantin Tokarev <ktokarev@smartlabs.tv>
date Tue, 01 Dec 2015 21:54:03 +0300
parents 64a50eac1030
children bf626d259eb1
files dbutil.c dbutil.h svr-main.c
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dbutil.c	Tue Dec 01 21:52:38 2015 +0300
+++ b/dbutil.c	Tue Dec 01 21:54:03 2015 +0300
@@ -84,9 +84,9 @@
 #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 */
--- a/dbutil.h	Tue Dec 01 21:52:38 2015 +0300
+++ b/dbutil.h	Tue Dec 01 21:54:03 2015 +0300
@@ -31,7 +31,7 @@
 #include "queue.h"
 
 #ifndef DISABLE_SYSLOG
-void startsyslog();
+void startsyslog(const char *ident);
 #endif
 
 #ifdef __GNUC__
--- a/svr-main.c	Tue Dec 01 21:52:38 2015 +0300
+++ b/svr-main.c	Tue Dec 01 21:54:03 2015 +0300
@@ -367,8 +367,8 @@
 
 	struct sigaction sa_chld;
 #ifndef DISABLE_SYSLOG
-		startsyslog();
 	if (opts.usingsyslog) {
+		startsyslog(PROGNAME);
 	}
 #endif