Просмотр исходного кода

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 19 лет назад
Родитель
Сommit
d1abf5ce4c
1 измененных файлов с 4 добавлено и 0 удалено
  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.