summaryrefslogtreecommitdiff
path: root/src/logger.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-31 21:22:44 +0200
committerLennart Poettering <lennart@poettering.net>2011-03-31 21:22:44 +0200
commit7d76f312889d54dcfe6fdde6eb055e890e7a615b (patch)
tree7ef1439ab07d28ca0a530d5643eec5bf0de33a40 /src/logger.c
parent29db583471f019ed9939a90966b3e194a9560e7e (diff)
log: fix shifting of facilities
Diffstat (limited to 'src/logger.c')
-rw-r--r--src/logger.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/logger.c b/src/logger.c
index 710dfed33b..eb62688f40 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -143,23 +143,12 @@ static int stream_log(Stream *s, char *p, usec_t ts) {
if (s->prefix)
parse_priority(&p, &priority);
- if (s->prefix &&
- p[0] == '<' &&
- p[1] >= '0' && p[1] <= '7' &&
- p[2] == '>') {
-
- /* Detected priority prefix */
- priority = LOG_MAKEPRI(LOG_FAC(priority), (p[1] - '0'));
-
- p += 3;
- }
-
if (*p == 0)
return 0;
/* Patch in LOG_USER facility if necessary */
- if (LOG_FAC(priority) == 0)
- priority = LOG_MAKEPRI(LOG_USER, LOG_PRI(priority));
+ if ((priority & LOG_FACMASK) == 0)
+ priority = LOG_USER | LOG_PRI(priority);
/*
* The format glibc uses to talk to the syslog daemon is: