log: make log_syntax() assign correct errno and show valid error cause

This commit is contained in:
Yu Watanabe
2019-03-04 15:18:06 +09:00
parent 892cd2f7ac
commit ee96382fdb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1223,7 +1223,7 @@ int log_syntax_internal(
log_target == LOG_TARGET_NULL)
return -ERRNO_VALUE(error);
errno = error;
errno = ERRNO_VALUE(error);
va_start(ap, format);
(void) vsnprintf(buffer, sizeof buffer, format, ap);
+1 -1
View File
@@ -308,7 +308,7 @@ int log_syntax_invalid_utf8_internal(
int _level = (level), _e = (error); \
(log_get_max_level() >= LOG_PRI(_level)) \
? log_syntax_internal(unit, _level, config_file, config_line, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \
: -abs(_e); \
: -ERRNO_VALUE(_e); \
})
#define log_syntax_invalid_utf8(unit, level, config_file, config_line, rvalue) \