summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2013-01-05 23:07:18 (GMT)
committer Mike Frysinger <vapier@gentoo.org>2013-01-06 02:03:19 (GMT)
commitd189b598b449f3a258354133180e7b770c04526c (patch)
treedde534ca9011514c102a6327aa49721833cdc0fc
parent3917fa32dce8c887d0a87d0d2f4490f1b89b51d0 (diff)
downloadbusybox-d189b598b449f3a258354133180e7b770c04526c.tar.gz
busybox-d189b598b449f3a258354133180e7b770c04526c.tar.bz2
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>
-rw-r--r--sysklogd/klogd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index f59a155..432ded1 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -240,11 +240,8 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
priority = LOG_INFO;
if (*start == '<') {
start++;
- if (*start) {
- /* kernel never generates multi-digit prios */
- priority = (*start - '0');
- start++;
- }
+ if (*start)
+ priority = strtoul(start, &start, 10);
if (*start == '>')
start++;
}