Commit f1a9cd4d authored by Pavel Emelyanov's avatar Pavel Emelyanov

[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: 's avatarAdrian Reber <adrian@lisas.de>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtouzzo.com>
Reviewed-by: 's avatarAdrian Reber <adrian@lisas.de>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3ea1d8ea
......@@ -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)
......
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