-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 $
*
* 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
*
#include <stdarg.h>
#include <string.h>
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__OS2__)
#include <unistd.h>
-#endif /* ndef _WIN32 */
+#endif /* !defined(_WIN32) && !defined(__OS2__) */
#include <errno.h>
+#include <assert.h>
#ifdef FEATURE_PTHREAD
#include <pthread.h>
#endif /* def FEATURE_PTHREAD */
#endif /* ndef _WIN_CONSOLE */
#endif /* def _WIN32 */
+#ifdef __OS2__
+#define INCL_DOS
+#include <os2.h>
+#endif
+
#include "errlog.h"
#include "project.h"
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)
/*
/* 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:
tab-width: 3
end:
*/
-