From ae7ae4f358a0d812eaf5b4e535b5471821a18371 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 31 May 2004 04:10:18 +0000 Subject: [PATCH] * error_message.c (terminated): New variable. (com_err_terminate): Set it. (remove_error_table): Check it, warn and abort if set. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16379 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/et/ChangeLog | 6 ++++++ src/util/et/error_message.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 4e99e206f..9115708fa 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,9 @@ +2004-05-31 Ken Raeburn + + * error_message.c (terminated): New variable. + (com_err_terminate): Set it. + (remove_error_table): Check it, warn and abort if set. + 2004-05-05 Ken Raeburn * error_message.c (buffer): Static variable deleted. diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index dd3c36fd0..e785172d9 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -57,6 +57,7 @@ int com_err_initialize(void) return 0; } +static int terminated = 0; /* for debugging shlib fini sequence errors */ void com_err_terminate(void) { struct dynamic_et_list *e, *enext; @@ -67,6 +68,7 @@ void com_err_terminate(void) enext = e->next; free(e); } + terminated = 1; } #ifndef DEBUG_TABLE_LIST @@ -301,6 +303,12 @@ remove_error_table(const struct error_table * et) if (CALL_INIT_FUNCTION(com_err_initialize)) return 0; +#if !defined(ENABLE_THREADS) && defined(DEBUG_THREADS) + if (et_list_lock.initialized == 0 && terminated != 0) { + fprintf(stderr, "\n\n *** Function remove_error_table called after com_err library termination. ***\n *** Shared library termination code executed in incorrect order? ***\n\n"); + abort(); + } +#endif merr = k5_mutex_lock(&et_list_lock); if (merr) return merr; -- 2.26.2