o clear lock fxn pointers when dlclosing the lock lib
return;
}
-static int load_lock_syms(struct log_data *data)
+static int load_lock_syms(void)
{
void *dlh;
/* 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;
}
}
/* 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;
+ }
}