klogd: handle multi-char log levels
Since Linux 3.5 (7ff9554bb5: printk: convert byte-buffer to variable-length record buffer), klog buffer can now contain log lines with multi-char loglevel indicators (<[0-9]+>) - So use strtoul to parse it. function old new delta klogd_main 490 525 +35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 35/0) Total: 35 bytes Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
3917fa32dc
commit
d189b598b4
@ -240,11 +240,8 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
priority = LOG_INFO;
|
priority = LOG_INFO;
|
||||||
if (*start == '<') {
|
if (*start == '<') {
|
||||||
start++;
|
start++;
|
||||||
if (*start) {
|
if (*start)
|
||||||
/* kernel never generates multi-digit prios */
|
priority = strtoul(start, &start, 10);
|
||||||
priority = (*start - '0');
|
|
||||||
start++;
|
|
||||||
}
|
|
||||||
if (*start == '>')
|
if (*start == '>')
|
||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user