-const char errlog_rcs[] = "$Id: errlog.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 2.1 2002/09/25 12:51:21 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/src/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 2.1 2002/09/25 12:51:21 oes
+ * Made log_error safe against NULL string arguments
+ *
* Revision 2.0 2002/06/04 14:34:21 jongfoster
* Moving source files to src/
*
/* FIXME get current thread id */
#ifdef FEATURE_PTHREAD
this_thread = (long)pthread_self();
+#ifdef __MACH__
+ /*
+ * Mac OSX (and perhaps other Mach instances) doesn't have a debuggable
+ * value at the first 4 bytes of pthread_self()'s return value, a pthread_t.
+ * pthread_t is supposed to be opaque... but it's fairly random, though, so
+ * we make it mostly presentable.
+ */
+ this_thread = abs(this_thread % 1000);
+#endif /* def __MACH__ */
#elif defined(_WIN32)
this_thread = GetCurrentThreadId();
#elif defined(__OS2__)
time (&now);
#ifdef HAVE_LOCALTIME_R
tm_now = *localtime_r(&now, &tm_now);
+#elif OSX_DARWIN
+ pthread_mutex_lock(&localtime_mutex);
+ tm_now = *localtime (&now);
+ pthread_mutex_unlock(&localtime_mutex);
#else
tm_now = *localtime (&now);
#endif
time (&now);
#ifdef HAVE_GMTIME_R
gmt = *gmtime_r(&now, &gmt);
+#elif OSX_DARWIN
+ pthread_mutex_lock(&gmtime_mutex);
+ gmt = *gmtime(&now);
+ pthread_mutex_unlock(&gmtime_mutex);
#else
gmt = *gmtime(&now);
#endif
#ifdef HAVE_LOCALTIME_R
tm_now = localtime_r(&now, &dummy);
+#elif OSX_DARWIN
+ pthread_mutex_lock(&localtime_mutex);
+ tm_now = localtime (&now);
+ pthread_mutex_unlock(&localtime_mutex);
#else
tm_now = localtime (&now);
#endif