mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
[PATCH[ log: Do not BUG_ON in log_first_err
It turned out that calling log_first_error() is possible w/o calling log_keep_first_err(), so don't bug_on() on it, just return NULL. Reported-by: Adrian Reber <adrian@lisas.de> Signed-off-by: Pavel Emelyanov <xemul@virtouzzo.com> Reviewed-by: Adrian Reber <adrian@lisas.de> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
@@ -114,8 +114,12 @@ static void log_note_err(char *msg)
|
||||
|
||||
char *log_first_err(void)
|
||||
{
|
||||
BUG_ON(!first_err);
|
||||
return first_err->s[0] == '\0' ? NULL : first_err->s;
|
||||
if (!first_err)
|
||||
return NULL;
|
||||
if (first_err->s[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
return first_err->s;
|
||||
}
|
||||
|
||||
int log_init(const char *output)
|
||||
|
Reference in New Issue
Block a user