Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311787
b: refs/heads/master
c: 43a73a5
h: refs/heads/master
i:
  311785: bf1524c
  311783: f5037ba
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent 3ce3506 commit 81cd720
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3f5a5f27153228569f3396049838e9727dae86e
refs/heads/master: 43a73a50b352cd3df25b3ced72033942a6a0f919
11 changes: 7 additions & 4 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,18 @@ static size_t print_time(u64 ts, char *buf)
static size_t print_prefix(const struct log *msg, bool syslog, char *buf)
{
size_t len = 0;
unsigned int prefix = (msg->facility << 3) | msg->level;

if (syslog) {
if (buf) {
len += sprintf(buf, "<%u>", msg->level);
len += sprintf(buf, "<%u>", prefix);
} else {
len += 3;
if (msg->level > 9)
len++;
if (msg->level > 99)
if (prefix > 999)
len += 3;
else if (prefix > 99)
len += 2;
else if (prefix > 9)
len++;
}
}
Expand Down

0 comments on commit 81cd720

Please sign in to comment.