From: Ken Raeburn Date: Tue, 21 Jun 2005 04:11:25 +0000 (+0000) Subject: * err_handle.c, kdb5.c: Test ENABLE_THREADS, not just HAVE_PTHREAD_H X-Git-Tag: ms-bug-test-20060525~220 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0cac0fc3a9f7a1db45fde8dde5d497f07c407ef2;p=krb5.git * 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 --- 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 + + * err_handle.c, kdb5.c: Test ENABLE_THREADS, not just + HAVE_PTHREAD_H. + 2005-06-20 Ken Raeburn 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 #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 #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