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
This commit is contained in:
Axel Dörfler 2003-11-13 02:51:15 +00:00
parent 37023b5035
commit fe4817d5c0

View File

@ -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);