summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-syslog.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/journal/journald-syslog.c
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 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.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);
}