summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2005-06-21 04:11:25 +0000
committerKen Raeburn <raeburn@mit.edu>2005-06-21 04:11:25 +0000
commit0cac0fc3a9f7a1db45fde8dde5d497f07c407ef2 (patch)
tree9bde608696a7cdefb0c40bd5b2172619e2ff8e52 /src
parent85861b62364e7e7de472bbfe55ca90cdf9aa8ddd (diff)
downloadkrb5-0cac0fc3a9f7a1db45fde8dde5d497f07c407ef2.tar.gz
krb5-0cac0fc3a9f7a1db45fde8dde5d497f07c407ef2.tar.xz
krb5-0cac0fc3a9f7a1db45fde8dde5d497f07c407ef2.zip
* err_handle.c, kdb5.c: Test ENABLE_THREADS, not just HAVE_PTHREAD_H
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17268 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/kdb/ChangeLog5
-rw-r--r--src/lib/kdb/err_handle.c11
-rw-r--r--src/lib/kdb/kdb5.c6
3 files changed, 16 insertions, 6 deletions
diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog
index 740cef026..bdfc8899d 100644
--- a/src/lib/kdb/ChangeLog
+++ b/src/lib/kdb/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-21 Ken Raeburn <raeburn@mit.edu>
+
+ * err_handle.c, kdb5.c: Test ENABLE_THREADS, not just
+ HAVE_PTHREAD_H.
+
2005-06-20 Ken Raeburn <raeburn@mit.edu>
Novell merge.
diff --git a/src/lib/kdb/err_handle.c b/src/lib/kdb/err_handle.c
index b70fbfe79..3130587fd 100644
--- a/src/lib/kdb/err_handle.c
+++ b/src/lib/kdb/err_handle.c
@@ -16,7 +16,7 @@ static char *_csrc =
safety requirement stops me from putting there. if I do, then all
the applications have to link to pthread. */
-#ifdef HAVE_PTHREAD_H
+#if defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H)
#include <pthread.h>
#endif
#include "err_handle.h"
@@ -34,7 +34,7 @@ typedef struct
krb5_context kcontext;
} krb5_err_struct_t;
-#ifdef HAVE_PTHREAD_H
+#if defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H)
static void
tsd_key_destructor(void *data)
{
@@ -138,8 +138,10 @@ static void
init_err_handling(void)
{
if (krb5_init_once) {
+#ifdef NOVELL
old_error_2_string = error_message;
error_message = krb5_get_err_string;
+#endif
krb5_init_once = FALSE;
}
}
@@ -189,8 +191,11 @@ krb5_get_err_string(long err_code)
/* It is not generated here. the remaining two cases are handled
by the default error string convertor. */
+#ifdef NOVELL
return old_error_2_string(err_code);
-
+#else
+ return error_message(err_code);
+#endif
}
void
diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c
index a79f6e3aa..0d6bded5f 100644
--- a/src/lib/kdb/kdb5.c
+++ b/src/lib/kdb/kdb5.c
@@ -2,7 +2,7 @@
* Include files
*/
-#ifdef HAVE_PTHREAD_H
+#if defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H)
#include <pthread.h>
#endif
@@ -27,7 +27,7 @@
* internal static variable
*/
-#ifdef HAVE_PTHREAD_H
+#if defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H)
/* static pthread_once_t db_inited = PTHREAD_ONCE_INIT; */
static pthread_mutex_t db_lock = PTHREAD_MUTEX_INITIALIZER;
#else
@@ -47,7 +47,7 @@ static db_library lib_list;
/*
* Helper Functions
*/
-#ifdef HAVE_PTHREAD_H
+#if defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H)
/*
* KNOWN ISSUES with locking: This code does not handle a scenario