浏览代码

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 年之前
父节点
当前提交
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)
 	if (LogFile < 0 || !connected)
 		openlog(LogTag, LogStat | LOG_NDELAY, 0);
 		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
 	/* 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
 	 * no longer than 64 characters plus length of the LogTag. So it's
 	 * safe to test only LogTag and use normal sprintf everywhere else.
 	 * safe to test only LogTag and use normal sprintf everywhere else.