X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=errlog.c;h=4fa729032d17cdfda5fa274f85b2e070c19eaabe;hp=b9ff49efd629953f4186f812fff188acf6521534;hb=5f390b415777db21894f1b856ab3d21c9c24f7c6;hpb=7a6bc2c1cf80345d0a120809bbde5ade5b4f4165 diff --git a/errlog.c b/errlog.c index b9ff49ef..4fa72903 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.19 2001/09/13 20:08:06 jongfoster Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.20 2001/09/16 23:04:34 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -33,6 +33,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.19 2001/09/13 20:08:06 jongfoster E * * Revisions : * $Log: errlog.c,v $ + * Revision 1.20 2001/09/16 23:04:34 jongfoster + * Fixing a warning + * * Revision 1.19 2001/09/13 20:08:06 jongfoster * Adding support for LOG_LEVEL_CGI * @@ -150,11 +153,12 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.19 2001/09/13 20:08:06 jongfoster E #include #include -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__OS2__) #include -#endif /* ndef _WIN32 */ +#endif /* !defined(_WIN32) && !defined(__OS2__) */ #include +#include #ifdef FEATURE_PTHREAD #include #endif /* def FEATURE_PTHREAD */ @@ -166,6 +170,11 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.19 2001/09/13 20:08:06 jongfoster E #endif /* ndef _WIN_CONSOLE */ #endif /* def _WIN32 */ +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + #include "errlog.h" #include "project.h" @@ -294,10 +303,14 @@ void init_error_log(const char *prog_name, const char *logfname, int debuglevel) void log_error(int loglevel, char *fmt, ...) { va_list ap; - char outbuf[BUFFER_SIZE]; + char *outbuf= NULL; char * src = fmt; int outc = 0; long this_thread = 1; /* was: pthread_t this_thread;*/ +#ifdef __OS2__ + PTIB ptib; + APIRET ulrc; +#endif /* __OS2__ */ #if defined(_WIN32) && !defined(_WIN_CONSOLE) /* @@ -320,8 +333,15 @@ void log_error(int loglevel, char *fmt, ...) /* FIXME get current thread id */ #ifdef FEATURE_PTHREAD this_thread = (long)pthread_self(); +#elif __OS2__ + + ulrc = DosGetInfoBlocks(&ptib, NULL); + if (ulrc == 0) + this_thread = ptib -> tib_ptib2 -> tib2_ultid; #endif /* def FEATURE_PTHREAD */ + outbuf = (char*)malloc(BUFFER_SIZE); + assert(outbuf); switch (loglevel) { case LOG_LEVEL_ERROR: @@ -743,4 +763,3 @@ static char *w32_socket_strerr(int errcode, char *tmp_buf) tab-width: 3 end: */ -