From 7de965260e8bca9fbc3d7c2fa5627a6e83c5de07 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 6 Nov 2012 13:37:15 +0400 Subject: [PATCH] log: Don't show time stamp on pr_msg In case if the pr_err happens before pr_msg, the string buffer will have dangling timestamp prefix. Skip it here. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/log.c b/log.c index 962989791..5fa1c6bef 100644 --- a/log.c +++ b/log.c @@ -182,11 +182,13 @@ void print_on_level(unsigned int loglevel, const char *format, ...) if (unlikely(loglevel == LOG_MSG)) { fd = STDOUT_FILENO; + off = buf_off; } else { if (loglevel > current_loglevel) return; fd = current_logfd; print_ts(); + off = 0; } va_start(params, format); @@ -195,7 +197,6 @@ void print_on_level(unsigned int loglevel, const char *format, ...) size += buf_off; - off = 0; while (off < size) { ret = write(fd, buffer + off, size - off); if (ret <= 0)