From: Andre Noll Date: Sat, 22 Jan 2011 13:18:09 +0000 (+0100) Subject: Simplify __log(). X-Git-Tag: v0.1.2~5 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=e826876808b34d21a2c4af7f0e066a1b188a7a28;p=osl.git Simplify __log(). No need for outfd as it is always stderr. --- 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); }