diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/journal/journald-syslog.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/journal/journald-syslog.c')
-rw-r--r-- | src/journal/journald-syslog.c | 12 |
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); } |