X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Flog.c;h=351c0bd1a82e35702ddd321024513b967a1b3f8b;hb=fd3e0c80b9b344777ef337909d197a14b69f251b;hp=4ff5e1853a304f8fcfb89680a4b01a6dbb104747;hpb=3879f5305286e152c9e16a5ccd20fbfc02428fce;p=yaz-moved-to-github.git diff --git a/src/log.c b/src/log.c index 4ff5e18..351c0bd 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.46 2007-02-05 17:51:48 adam Exp $ + * $Id: log.c,v 1.48 2007-02-23 10:15:01 adam Exp $ */ /** @@ -36,6 +36,7 @@ #include #include #include +#include #include static NMEM_MUTEX log_mutex = 0; @@ -388,7 +389,7 @@ static void yaz_strftime(char *dst, size_t sz, #ifdef WIN32 DWORD tid = GetCurrentThreadId(); #else - long tid = 0; + pthread_t tid = 0; #if YAZ_POSIX_THREADS tid = pthread_self(); #endif @@ -472,17 +473,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, " [");