mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
print_on_level(): simplify off setting code
This is a slight refactoring of commit 7de9652, which just simplifies
initialization of 'off' variable, and adds the comment why we do so.
Should make the next patch easier to read.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
81ee51f0e8
commit
3d9ff2706f
1 changed files with 2 additions and 3 deletions
5
log.c
5
log.c
|
|
@ -138,17 +138,16 @@ unsigned int log_get_loglevel(void)
|
|||
|
||||
static void __print_on_level(unsigned int loglevel, const char *format, va_list params)
|
||||
{
|
||||
int fd, size, ret, off;
|
||||
int fd, size, ret, off = 0;
|
||||
|
||||
if (unlikely(loglevel == LOG_MSG)) {
|
||||
fd = STDOUT_FILENO;
|
||||
off = buf_off;
|
||||
off = buf_off; /* skip dangling timestamp */
|
||||
} else {
|
||||
if (loglevel > current_loglevel)
|
||||
return;
|
||||
fd = log_get_fd();
|
||||
print_ts();
|
||||
off = 0;
|
||||
}
|
||||
|
||||
size = vsnprintf(buffer + buf_off, PAGE_SIZE - buf_off, format, params);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue