X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Flog.c;h=ced99c5b70ce38776c349501171a86abcf69a3c2;hb=3cdfbd27dfc8dd15619f127ae78bf0f71b27dd6d;hp=ed2e05e9f278e24927a432fb0c76da85bd619f8a;hpb=adf2f426ab3869f3550d3cd56f48d0590d50f502;p=yaz-moved-to-github.git diff --git a/src/log.c b/src/log.c index ed2e05e..ced99c5 100644 --- a/src/log.c +++ b/src/log.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: log.c,v 1.47 2007-02-20 09:39:17 adam Exp $ + * $Id: log.c,v 1.49 2007-03-22 09:13:13 adam Exp $ */ /** @@ -36,6 +36,7 @@ #include #include #include +#include #include static NMEM_MUTEX log_mutex = 0; @@ -388,9 +389,10 @@ static void yaz_strftime(char *dst, size_t sz, #ifdef WIN32 DWORD tid = GetCurrentThreadId(); #else - pthread_t tid = 0; #if YAZ_POSIX_THREADS - tid = pthread_self(); + pthread_t tid = pthread_self(); +#else + long tid = 0; #endif #endif memcpy(fmt2, fmt, cp-fmt); @@ -472,17 +474,8 @@ void yaz_log(int level, const char *fmt, ...) if (!(level & l_level)) return; va_start(ap, fmt); -#ifdef WIN32 - _vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#else -/* !WIN32 */ -#if HAVE_VSNPRINTF - vsnprintf(buf, sizeof(buf), fmt, ap); -#else - vsprintf(buf, fmt, ap); -#endif -#endif -/* WIN32 */ + + yaz_vsnprintf(buf, sizeof(buf)-1, fmt, ap); if (o_level & YLOG_ERRNO) { strcat(buf, " [");