In general, log_syntax_internal() must keep errno unchanged. But the
call to log_syntax_callback() was added outside of the block protected
by PROTECT_ERRNO.
const char *func,
const char *format, ...) {
+ PROTECT_ERRNO;
+
if (log_syntax_callback)
log_syntax_callback(unit, level, log_syntax_callback_userdata);
- PROTECT_ERRNO;
- char buffer[LINE_MAX];
- va_list ap;
- const char *unit_fmt = NULL;
-
if (_likely_(LOG_PRI(level) > log_max_level) ||
log_target == LOG_TARGET_NULL)
return -ERRNO_VALUE(error);
+ char buffer[LINE_MAX];
+ va_list ap;
+ const char *unit_fmt = NULL;
+
errno = ERRNO_VALUE(error);
va_start(ap, format);