diff --git a/log.c b/log.c index a9f1757ef..e32e38b2a 100644 --- a/log.c +++ b/log.c @@ -155,6 +155,7 @@ unsigned int log_get_loglevel(void) static void __print_on_level(unsigned int loglevel, const char *format, va_list params) { int fd, size, ret, off = 0; + int __errno = errno; if (unlikely(loglevel == LOG_MSG)) { fd = STDOUT_FILENO; @@ -176,6 +177,7 @@ static void __print_on_level(unsigned int loglevel, const char *format, va_list break; off += ret; } + errno = __errno; } void print_on_level(unsigned int loglevel, const char *format, ...)