diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-03-31 19:49:04 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-03-31 19:49:04 +0200 |
commit | 29db583471f019ed9939a90966b3e194a9560e7e (patch) | |
tree | a96edbaf00e9a787df07a5e3ba791bfc9f0b450c /src/log.c | |
parent | 7602c46fe6c48792b5eb4d157233066c68be9c9a (diff) |
log: don't strip facility when writing to kmsg
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -289,7 +289,7 @@ static int write_to_syslog( if (syslog_fd < 0) return 0; - snprintf(header_priority, sizeof(header_priority), "<%i>", LOG_MAKEPRI(LOG_DAEMON, LOG_PRI(level))); + snprintf(header_priority, sizeof(header_priority), "<%i>", level); char_array_0(header_priority); t = (time_t) (now(CLOCK_REALTIME) / USEC_PER_SEC); @@ -346,7 +346,7 @@ static int write_to_kmsg( if (kmsg_fd < 0) return 0; - snprintf(header_priority, sizeof(header_priority), "<%i>", LOG_PRI(level)); + snprintf(header_priority, sizeof(header_priority), "<%i>", level); char_array_0(header_priority); snprintf(header_pid, sizeof(header_pid), "[%lu]: ", (unsigned long) getpid()); @@ -377,6 +377,10 @@ static int log_dispatch( if (log_target == LOG_TARGET_NULL) return 0; + /* Patch in LOG_DAEMON facility if necessary */ + if (LOG_FAC(level) == 0) + level = LOG_MAKEPRI(LOG_DAEMON, LOG_PRI(level)); + do { char *e; int k = 0; |