From 1fbf276eb4811810a011afd31b5abdd0d4a948e5 Mon Sep 17 00:00:00 2001 From: AJ Lewis Date: Wed, 4 May 2005 19:02:27 +0000 Subject: [PATCH] o load_lock_syms doesn't need args o clear lock fxn pointers when dlclosing the lock lib --- multilog/libmultilog.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/multilog/libmultilog.c b/multilog/libmultilog.c index dd0c970..33020e0 100644 --- a/multilog/libmultilog.c +++ b/multilog/libmultilog.c @@ -91,7 +91,7 @@ static void destroy_nop_lock(void *handle) return; } -static int load_lock_syms(struct log_data *data) +static int load_lock_syms(void) { void *dlh; @@ -209,7 +209,7 @@ int multilog_add_type(enum log_type type, struct log_data *data) /* FIXME: Potential race here */ /* attempt to load locking protocol */ if(!init_lock_fn) { - if(!load_lock_syms(data)) { + if(!load_lock_syms()) { fprintf(stderr, "Unalbe to load locking\n"); return 0; } @@ -313,7 +313,14 @@ void multilog_clear_logging(void) } /* FIXME: Not sure the destroy_lock call is really necessary */ destroy_lock(lock_handle); - dlclose(lock_dlh); + + if(lock_dlh) { + dlclose(lock_dlh); + init_lock_fn = NULL; + lock_fn = NULL; + unlock_fn = NULL; + destroy_lock_fn = NULL; + } } -- 2.43.5