]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Undo Novell's change to the com_err API. novell-dal-branch
authorKen Raeburn <raeburn@mit.edu>
Fri, 17 Jun 2005 23:28:01 +0000 (23:28 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 17 Jun 2005 23:28:01 +0000 (23:28 +0000)
Bludgeon their other code into compiling with the reverted API.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/novell-dal-branch@17254 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/clnt/err_handle.c
src/lib/kdb/err_handle.c
src/util/et/com_err.c
src/util/et/com_err.h
src/util/et/error_message.c

index 0b44d36ef4fdf3521ae968a0341be6b7df4196b9..997544d5e6dab50c728934858bc7d49592bb50cc 100644 (file)
@@ -20,7 +20,9 @@ static char *_csrc = "@(#) %filespec: err_handle.c~1 %  (%full_filespec: err_han
 #include "err_handle.h"
 #include <assert.h>
 
+#ifdef NOVELL
 krb5_errcode_2_string_func old_error_2_string = NULL;
+#endif
 
 typedef struct {
     char krb5_err_str[KRB5_MAX_ERR_STR + 1];
@@ -40,8 +42,10 @@ static pthread_key_t krb5_err_key;
 static void init_err_handling( void )
 {
     assert(!pthread_key_create(&krb5_err_key, tsd_key_destructor));
+#ifdef NOVELL
     old_error_2_string = error_message;
     error_message = krb5_get_err_string;
+#endif
 }
 
 static pthread_once_t krb5_key_create = PTHREAD_ONCE_INIT;
@@ -94,8 +98,11 @@ const char * KRB5_CALLCONV krb5_get_err_string(long err_code)
     }
 
     /* Error strings are 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 krb5_clr_error()
@@ -116,8 +123,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;
     }
 }
@@ -156,8 +165,11 @@ const char * KRB5_CALLCONV 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 krb5_clr_error()
index 61f720eea20b4d1b5c820e110d3a77da71a812fb..7d54441cb5eb2614ef62cf4f593da5ff4f1f036f 100644 (file)
@@ -11,8 +11,9 @@
 static char *_csrc = "@(#) %filespec: err_handle.c~1 %  (%full_filespec: err_handle.c~1:csrc:idc_sec#1 %)";
 #endif
 
-/* this file should be ideally be in util/et. But, for now thread safety requirement stops me from putting there. 
- if I do, then all the applications have to link to pthread */
+/* This file should be ideally be in util/et.  But, for now thread
+   safety requirement stops me from putting there.  if I do, then all
+   the applications have to link to pthread.  */
 
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
@@ -20,7 +21,9 @@ static char *_csrc = "@(#) %filespec: err_handle.c~1 %  (%full_filespec: err_han
 #include "err_handle.h"
 #include <assert.h>
 
+#ifdef NOVELL
 krb5_errcode_2_string_func old_error_2_string = NULL;
+#endif
 
 typedef struct {
     char krb5_err_str[KRB5_MAX_ERR_STR + 1];
@@ -40,8 +43,10 @@ static pthread_key_t krb5_err_key;
 static void init_err_handling( void )
 {
     assert(!pthread_key_create(&krb5_err_key, tsd_key_destructor));
+#ifdef NOVELL
     old_error_2_string = error_message;
     error_message = krb5_get_err_string;
+#endif
 }
 
 static pthread_once_t krb5_key_create = PTHREAD_ONCE_INIT;
@@ -100,8 +105,11 @@ const char * KRB5_CALLCONV krb5_get_err_string(long err_code)
     }
 
     /* Error strings are 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 krb5_clr_error()
index 5d7b50e8dcc521c84cf1a7d98b3c37d0429c58a0..94b379816dc7d18d5598093d695b5df9b035afeb 100644 (file)
@@ -32,7 +32,6 @@
 
 static /*@null@*/ et_old_error_hook_func com_err_hook = 0;
 k5_mutex_t com_err_hook_lock = K5_MUTEX_PARTIAL_INITIALIZER;
-krb5_errcode_2_string_func error_message = krb5_errcode_2_string;
 
 static void default_com_err_proc (const char *whoami, errcode_t code,
                                  const char *fmt, va_list ap)
index b2a4b80d2eaabfa1e49c14a0048b106c411b3322..042a9bd4524f3751ed4c8a025470160b9e647a00 100644 (file)
@@ -37,15 +37,13 @@ struct error_table {
 extern "C" {
 #endif
 
-  typedef const char * KRB5_CALLCONV (*krb5_errcode_2_string_func)(long code);
-
 /* Public interfaces */
 extern void KRB5_CALLCONV_C com_err
        (const char *, errcode_t, const char *, ...);
 extern void KRB5_CALLCONV com_err_va
        (const char *whoami, errcode_t code, const char *fmt,
         va_list ap);
-  extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV (*error_message)
+extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message
        (errcode_t)
        /*@modifies internalState@*/;
 extern errcode_t KRB5_CALLCONV add_error_table
@@ -54,8 +52,6 @@ extern errcode_t KRB5_CALLCONV add_error_table
 extern errcode_t KRB5_CALLCONV remove_error_table
        (const struct error_table *)
        /*@modifies internalState@*/;
-       /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV krb5_errcode_2_string
-       (errcode_t);
 
 #if !defined(_WIN32)
 /*
index 518a4ee7ac778cd8ae5c58153cbc26793f36586d..b7f8947d2926e4add0c4be53841e76e7ae3f9069 100644 (file)
@@ -92,7 +92,7 @@ void com_err_terminate(void)
 #endif
 
 const char * KRB5_CALLCONV
-krb5_errcode_2_string(long code)
+error_message(long code)
     /*@modifies internalState@*/
 {
        unsigned long offset;