mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 09:05:10 +00:00
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 <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
c80b08643f
commit
7de965260e
1 changed files with 2 additions and 1 deletions
3
log.c
3
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue