From: Ken Raeburn Date: Sat, 2 Jul 2005 03:00:13 +0000 (+0000) Subject: * err_handle.c (krb5_err_key): Variable deleted. X-Git-Tag: ms-bug-test-20060525~200 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0472710f959cb45d8a2d7eed72dd1da28ef76cb;p=krb5.git * err_handle.c (krb5_err_key): Variable deleted. (init_err_handling, krb5_set_err, krb5_get_err_string, krb5_clr_error): Use k5_ macros for thread-specific data instead of pthread versions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17288 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/clnt/ChangeLog b/src/lib/kadm5/clnt/ChangeLog index a296c1e7d..578acba3c 100644 --- a/src/lib/kadm5/clnt/ChangeLog +++ b/src/lib/kadm5/clnt/ChangeLog @@ -1,3 +1,10 @@ +2005-07-01 Ken Raeburn + + * err_handle.c (krb5_err_key): Variable deleted. + (init_err_handling, krb5_set_err, krb5_get_err_string, + krb5_clr_error): Use k5_ macros for thread-specific data instead + of pthread versions. + 2005-06-20 Ken Raeburn Novell merge. diff --git a/src/lib/kadm5/clnt/err_handle.c b/src/lib/kadm5/clnt/err_handle.c index 99d8c9423..24bf2912e 100644 --- a/src/lib/kadm5/clnt/err_handle.c +++ b/src/lib/kadm5/clnt/err_handle.c @@ -41,12 +41,10 @@ tsd_key_destructor(void *data) free(data); } -static pthread_key_t krb5_err_key; - static void init_err_handling(void) { - assert(!pthread_key_create(&krb5_err_key, tsd_key_destructor)); + assert(!k5_key_register(K5_KEY_KADM_CLNT_ERR_HANDLER, tsd_key_destructor)); #ifdef NOVELL old_error_2_string = error_message; error_message = krb5_get_err_string; @@ -63,13 +61,13 @@ krb5_set_err(krb5_context kcontext, krb5_err_subsystem subsystem, krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KADM_CLNT_ERR_HANDLER); if (err_struct == NULL) { err_struct = calloc(sizeof(krb5_err_struct_t), 1); if (err_struct == NULL) return ENOMEM; - if ((ret = pthread_setspecific(krb5_err_key, err_struct))) { + if ((ret = k5_setspecific(K5_KEY_KADM_CLNT_ERR_HANDLER, err_struct))) { free(err_struct); return ret; } @@ -93,7 +91,7 @@ krb5_get_err_string(long err_code) krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KADM_CLNT_ERR_HANDLER); if (err_struct && (err_struct->subsystem == krb5_err_have_str) && (err_code == err_struct->err_code)) { /* checking error code is for safety. @@ -119,7 +117,7 @@ krb5_clr_error() krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KADM_CLNT_ERR_HANDLER); if (err_struct) err_struct->subsystem = krb5_err_unknown; } diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index ddeb00f54..b17d580d5 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,10 @@ +2005-07-01 Ken Raeburn + + * err_handle.c (krb5_err_key): Variable deleted. + (init_err_handling, krb5_set_err, krb5_get_err_string, + krb5_clr_error): Use k5_ macros for thread-specific data instead + of pthread versions. + 2005-06-29 Ken Raeburn * Makefile.in (t_kdb, check, clean): Delete t_kdb references. diff --git a/src/lib/kdb/err_handle.c b/src/lib/kdb/err_handle.c index 3130587fd..bfd3c752c 100644 --- a/src/lib/kdb/err_handle.c +++ b/src/lib/kdb/err_handle.c @@ -41,12 +41,10 @@ tsd_key_destructor(void *data) free(data); } -static pthread_key_t krb5_err_key; - static void init_err_handling(void) { - assert(!pthread_key_create(&krb5_err_key, tsd_key_destructor)); + assert(!k5_key_register(K5_KEY_KDB_ERR_HANDLER, tsd_key_destructor)); #ifdef NOVELL old_error_2_string = error_message; error_message = krb5_get_err_string; @@ -63,13 +61,13 @@ krb5_set_err(krb5_context kcontext, krb5_err_subsystem subsystem, krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KDB_ERR_HANDLER); if (err_struct == NULL) { err_struct = calloc(sizeof(krb5_err_struct_t), 1); if (err_struct == NULL) return ENOMEM; - if ((ret = pthread_setspecific(krb5_err_key, err_struct))) { + if ((ret = k5_setspecific(K5_KEY_KDB_ERR_HANDLER, err_struct))) { free(err_struct); return ret; } @@ -93,7 +91,7 @@ krb5_get_err_string(long err_code) krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KDB_ERR_HANDLER); if (err_struct && (err_struct->subsystem == krb5_err_have_str) && (err_code == err_struct->err_code)) { /* Checking error code is for safety. @@ -125,7 +123,7 @@ krb5_clr_error() krb5_err_struct_t *err_struct; pthread_once(&krb5_key_create, init_err_handling); - err_struct = (krb5_err_struct_t *) pthread_getspecific(krb5_err_key); + err_struct = (krb5_err_struct_t *) k5_getspecific(K5_KEY_KDB_ERR_HANDLER); if (err_struct) err_struct->subsystem = krb5_err_unknown; }