From fe4817d5c05b92225324a45cb5514954425c5cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 13 Nov 2003 02:51:15 +0000 Subject: [PATCH] Didn't set the facility correctly if set from both, openlog() and syslog(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5342 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/syslog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/libroot/posix/syslog.cpp b/src/kernel/libroot/posix/syslog.cpp index 3de2b3d3f4..ebc9c05533 100644 --- a/src/kernel/libroot/posix/syslog.cpp +++ b/src/kernel/libroot/posix/syslog.cpp @@ -124,13 +124,17 @@ send_syslog_message(syslog_context *context, int priority, const char *text, va_ return; } + // adopt facility from openlog() if not yet set + if (SYSLOG_FACILITY(priority) == 0) + priority |= context->facility; + char buffer[2048]; syslog_message &message = *(syslog_message *)&buffer[0]; message.from = find_thread(NULL); message.when = real_time_clock(); message.options = options; - message.priority = priority | context->facility; + message.priority = priority; strcpy(message.ident, context->ident); int length = vsnprintf(message.message, sizeof(buffer) - sizeof(syslog_message), text, args);