From 2016dceaa9cfc65ee80ee7e433331390f4263744 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Mon, 12 Jan 2026 16:30:37 -0600 Subject: download jobs --- lib/log.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/log.c') diff --git a/lib/log.c b/lib/log.c index 4924782..6f0f40a 100644 --- a/lib/log.c +++ b/lib/log.c @@ -1,5 +1,6 @@ #include #include +#include #include "log.h" /* TODO: replace this with something thread-safe later. */ @@ -41,6 +42,7 @@ void vl_logv(unsigned level, const char *fmt, va_list args) char datebuf[MAX_LOGTIMELEN]; time_t now; struct tm now_tm; + int en = errno; if (log_level > level) return; if (level > LOG_ERROR) return; @@ -55,7 +57,9 @@ void vl_logv(unsigned level, const char *fmt, va_list args) strcpy(datebuf, "???"); } - fprintf(log_stream(level), "[%s] %s: %s\n", datebuf, log_names[level], buf); + fprintf(log_stream(level), "[%s] %5s: %s\n", datebuf, log_names[level], buf); + + errno = en; } void vl_log(unsigned level, const char *fmt, ...) -- cgit v1.2.3-70-g09d2