summaryrefslogtreecommitdiff
path: root/libc/misc/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/syslog')
-rw-r--r--libc/misc/syslog/syslog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index e39e63a05..2b478e13d 100644
--- a/libc/misc/syslog/syslog.c
+++ b/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.