Browse Source

cbachman writes Bug 195:
Add back in the code which sets the default facility if none specified. This
may cause issues with klogd when it tries to use the libc's syslog(), but
klogd comes with its own syslog() implementation so that's a none issue. For
more info, please see the following:
http://sources.redhat.com/ml/libc-alpha/2000-03/msg00059.html

Mike Frysinger 20 years ago
parent
commit
d1abf5ce4c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libc/misc/syslog/syslog.c

+ 4 - 0
libc/misc/syslog/syslog.c

@@ -173,6 +173,10 @@ vsyslog( int pri, const char *fmt, va_list ap )
 	if (LogFile < 0 || !connected)
 		openlog(LogTag, LogStat | LOG_NDELAY, 0);
 
+	/* Set default facility if none specified. */
+	if ((pri & LOG_FACMASK) == 0)
+		pri |= LogFacility;
+
 	/* Build the message. We know the starting part of the message can take
 	 * no longer than 64 characters plus length of the LogTag. So it's
 	 * safe to test only LogTag and use normal sprintf everywhere else.