summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-syslog.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/journal/journald-syslog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
index f6accb5..4ad73ed 100644
--- a/src/journal/journald-syslog.c
+++ b/src/journal/journald-syslog.c
@@ -177,8 +177,8 @@ void server_forward_syslog(Server *s, int priority, const char *identifier, cons
int syslog_fixup_facility(int priority) {
- if ((priority & LOG_FACMASK) == 0)
- return (priority & LOG_PRIMASK) | LOG_USER;
+ if (LOG_FAC(priority) == 0)
+ return LOG_PRI(priority) | LOG_USER;
return priority;
}
@@ -314,8 +314,8 @@ void server_process_syslog_message(
const char *label,
size_t label_len) {
- char *t, syslog_priority[sizeof("PRIORITY=") + DECIMAL_STR_MAX(int)],
- syslog_facility[sizeof("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(int)];
+ char *t, syslog_priority[STRLEN("PRIORITY=") + DECIMAL_STR_MAX(int)],
+ syslog_facility[STRLEN("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(int)];
const char *msg, *syslog_ts, *a;
_cleanup_free_ char *identifier = NULL, *pid = NULL,
*dummy = NULL, *msg_msg = NULL, *msg_raw = NULL;
@@ -403,10 +403,10 @@ void server_process_syslog_message(
iovec[n++] = IOVEC_MAKE_STRING("_TRANSPORT=syslog");
- xsprintf(syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK);
+ xsprintf(syslog_priority, "PRIORITY=%i", LOG_PRI(priority));
iovec[n++] = IOVEC_MAKE_STRING(syslog_priority);
- if (priority & LOG_FACMASK) {
+ if (LOG_FAC(priority) != 0) {
xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority));
iovec[n++] = IOVEC_MAKE_STRING(syslog_facility);
}