log: LOG_ERRNO_P(), like LOG_ERRNO(), except user provides errno value

This commit is contained in:
Daniel Eklöf 2018-12-31 13:18:22 +01:00
parent 4c4f0ce7a0
commit 0ea4e5a2d8
2 changed files with 18 additions and 0 deletions

10
log.c
View file

@ -63,3 +63,13 @@ void log_errno(enum log_class log_class, const char *module,
_log(log_class, module, file, lineno, fmt, errno, ap);
va_end(ap);
}
void log_errno_provided(enum log_class log_class, const char *module,
const char *file, int lineno, int _errno,
const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
_log(log_class, module, file, lineno, fmt, _errno, ap);
va_end(ap);
}