summaryrefslogtreecommitdiff
path: root/src/journal/journald-kmsg.c
diff options
context:
space:
mode:
authorMichal Sekletar <msekleta@redhat.com>2014-07-25 14:38:22 +0200
committerMichal Sekletar <msekleta@redhat.com>2014-07-28 10:25:49 +0200
commit36dd072cdf03dcac0fcd2d6b42f261444dc7ac88 (patch)
tree845f5b063bdd221cd73ac9e35ba409225365d081 /src/journal/journald-kmsg.c
parentc317a1a19cd9584e07ee43f1b6fafc26c2c75cca (diff)
journald: always add syslog facility for messages coming from kmsg
Set SYSLOG_FACILITY field for kernel log messages too. Setting only SYSLOG_IDENTIFIER="kernel" is not sufficient and tools reading journal maybe confused by missing SYSLOG_FACILITY field for kernel log messages.
Diffstat (limited to 'src/journal/journald-kmsg.c')
-rw-r--r--src/journal/journald-kmsg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 12992e7d78..bb62a76ff2 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -274,6 +274,9 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
if (asprintf(&syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK) >= 0)
IOVEC_SET_STRING(iovec[n++], syslog_priority);
+ if (asprintf(&syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)) >= 0)
+ IOVEC_SET_STRING(iovec[n++], syslog_facility);
+
if ((priority & LOG_FACMASK) == LOG_KERN)
IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=kernel");
else {
@@ -295,9 +298,6 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
if (syslog_pid)
IOVEC_SET_STRING(iovec[n++], syslog_pid);
}
-
- if (asprintf(&syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)) >= 0)
- IOVEC_SET_STRING(iovec[n++], syslog_facility);
}
message = cunescape_length_with_prefix(p, pl, "MESSAGE=");