1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-07-18 04:58:57 +03:00

cleanup: put easier tests first

If we could 'break' before calling strcmp() do it.
Use fputc for single char output (\n).
This commit is contained in:
Zdenek Kabelac
2015-04-13 11:39:23 +02:00
parent 0b99d648ef
commit 29467abe59

View File

@ -299,13 +299,13 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,
va_start(ap, format);
switch (level) {
case _LOG_DEBUG:
if ((verbose_level() == level) &&
(strcmp("<backtrace>", format) == 0))
break;
if (verbose_level() < _LOG_DEBUG)
break;
if (!debug_class_is_logged(dm_errno_or_class))
break;
if ((verbose_level() == level) &&
(strcmp("<backtrace>", format) == 0))
break;
/* fall through */
default:
/* Typically only log_warn goes to stdout */
@ -333,7 +333,7 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,
vfprintf(_log_file, trformat, ap);
va_end(ap);
fprintf(_log_file, "\n");
fputc('\n', _log_file);
fflush(_log_file);
}