Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Undo Novell's change to the com_err API.

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
  • Loading branch information...
commit dfdc5fd861cf21419de6a8e0b65ee94c8c2f484a 1 parent ebe9038
raeburn authored
16 src/lib/kadm5/clnt/err_handle.c
View
@@ -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()
14 src/lib/kdb/err_handle.c
View
@@ -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()
1  src/util/et/com_err.c
View
@@ -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)
6 src/util/et/com_err.h
View
@@ -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)
/*
2  src/util/et/error_message.c
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.