From e826876808b34d21a2c4af7f0e066a1b188a7a28 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 22 Jan 2011 14:18:09 +0100 Subject: [PATCH] Simplify __log(). No need for outfd as it is always stderr. --- osl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osl.c b/osl.c index 90601dc..d12b6b2 100644 --- a/osl.c +++ b/osl.c @@ -61,20 +61,18 @@ static void __attribute ((constructor)) init_loglevel(void) __printf_2_3 void __log(int ll, const char* fmt,...) { va_list argp; - FILE *outfd; struct tm *tm; time_t t1; char str[255] = ""; if (ll < loglevel) return; - outfd = stderr; time(&t1); tm = localtime(&t1); strftime(str, sizeof(str), "%b %d %H:%M:%S", tm); - fprintf(outfd, "%s ", str); + fprintf(stderr, "%s ", str); va_start(argp, fmt); - vfprintf(outfd, fmt, argp); + vfprintf(stderr, fmt, argp); va_end(argp); } -- 2.39.2