X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fjournal%2Fjournald-syslog.c;h=21bc9679c2b3686d57a9df167c5c73f420212b06;hp=5d211323adef015cbb4b68dd61a18d3bccbc3a3b;hb=3d7415f43f0fe6a821d7bc4a341ba371e8a30ef3;hpb=f4c135bf2f0abcf79c89efbeae51f03bacba5f2f diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 5d211323a..21bc9679c 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -238,46 +238,6 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) return e; } -void syslog_parse_priority(const char **p, int *priority, bool with_facility) { - int a = 0, b = 0, c = 0; - int k; - - assert(p); - assert(*p); - assert(priority); - - if ((*p)[0] != '<') - return; - - if (!strchr(*p, '>')) - return; - - if ((*p)[2] == '>') { - c = undecchar((*p)[1]); - k = 3; - } else if ((*p)[3] == '>') { - b = undecchar((*p)[1]); - c = undecchar((*p)[2]); - k = 4; - } else if ((*p)[4] == '>') { - a = undecchar((*p)[1]); - b = undecchar((*p)[2]); - c = undecchar((*p)[3]); - k = 5; - } else - return; - - if (a < 0 || b < 0 || c < 0 || - (!with_facility && (a || b || c > 7))) - return; - - if (with_facility) - *priority = a*100 + b*10 + c; - else - *priority = (*priority & LOG_FACMASK) | c; - *p += k; -} - static void syslog_skip_date(char **buf) { enum { LETTER,