-const char errlog_rcs[] = "$Id: errlog.c,v 1.44 2006/08/18 16:03:16 david__schmidt Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.46 2006/11/13 19:05:51 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.46 2006/11/13 19:05:51 fabiankeil
+ * Make pthread mutex locking more generic. Instead of
+ * checking for OSX and OpenBSD, check for FEATURE_PTHREAD
+ * and use mutex locking unless there is an _r function
+ * available. Better safe than sorry.
+ *
+ * Fixes "./configure --disable-pthread" and should result
+ * in less threading-related problems on pthread-using platforms,
+ * but it still doesn't fix BR#1122404.
+ *
+ * Revision 1.45 2006/08/21 11:15:54 david__schmidt
+ * MS Visual C++ build updates
+ *
* Revision 1.44 2006/08/18 16:03:16 david__schmidt
* Tweak for OS/2 build happiness.
*
#include <errno.h>
#include <assert.h>
-#ifdef FEATURE_PTHREAD
-#include <pthread.h>
-#endif /* def FEATURE_PTHREAD */
#ifdef _WIN32
#ifndef STRICT
#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
#if defined(unix)
- unlink(pidfile);
+ if(pidfile)
+ {
+ unlink(pidfile);
+ }
#endif /* unix */
exit(1);
time (&now);
#ifdef HAVE_LOCALTIME_R
tm_now = *localtime_r(&now, &tm_now);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&localtime_mutex);
tm_now = *localtime (&now);
pthread_mutex_unlock(&localtime_mutex);
time (&now);
#ifdef HAVE_GMTIME_R
gmt = *gmtime_r(&now, &gmt);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
gmt = *gmtime(&now);
pthread_mutex_unlock(&gmtime_mutex);
#endif
#ifdef HAVE_LOCALTIME_R
tm_now = localtime_r(&now, &dummy);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&localtime_mutex);
tm_now = localtime (&now);
pthread_mutex_unlock(&localtime_mutex);