Commit 7de96526 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c80b0864
...@@ -182,11 +182,13 @@ void print_on_level(unsigned int loglevel, const char *format, ...) ...@@ -182,11 +182,13 @@ void print_on_level(unsigned int loglevel, const char *format, ...)
if (unlikely(loglevel == LOG_MSG)) { if (unlikely(loglevel == LOG_MSG)) {
fd = STDOUT_FILENO; fd = STDOUT_FILENO;
off = buf_off;
} else { } else {
if (loglevel > current_loglevel) if (loglevel > current_loglevel)
return; return;
fd = current_logfd; fd = current_logfd;
print_ts(); print_ts();
off = 0;
} }
va_start(params, format); va_start(params, format);
...@@ -195,7 +197,6 @@ void print_on_level(unsigned int loglevel, const char *format, ...) ...@@ -195,7 +197,6 @@ void print_on_level(unsigned int loglevel, const char *format, ...)
size += buf_off; size += buf_off;
off = 0;
while (off < size) { while (off < size) {
ret = write(fd, buffer + off, size - off); ret = write(fd, buffer + off, size - off);
if (ret <= 0) if (ret <= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment