changed to use lt_dlopenadvise() instead of lt_dlopenext()

This commit is contained in:
hyung-hwan 2015-10-26 16:40:09 +00:00
parent cb61a8ac69
commit c42a9945b1
2 changed files with 16 additions and 2 deletions

View File

@ -210,7 +210,7 @@ this tokenization process.
### Comments ### ### Comments ###
A comment is a part of the program text excluded during tokenization. You can A comment is part of the program text excluded during tokenization. You can
put descriptive text about the program in a comment. put descriptive text about the program in a comment.
A single-line comment is introduced by a hash character #, and is terminated at A single-line comment is introduced by a hash character #, and is terminated at

View File

@ -222,6 +222,7 @@ void* qse_awk_stdmodopen (qse_awk_t* awk, const qse_awk_mod_spec_t* spec)
{ {
#if defined(USE_LTDL) #if defined(USE_LTDL)
void* h; void* h;
lt_dladvise adv;
qse_mchar_t* modpath; qse_mchar_t* modpath;
const qse_char_t* tmp[4]; const qse_char_t* tmp[4];
int count; int count;
@ -252,7 +253,20 @@ void* qse_awk_stdmodopen (qse_awk_t* awk, const qse_awk_mod_spec_t* spec)
return QSE_NULL; return QSE_NULL;
} }
h = lt_dlopenext (modpath); if (lt_dladvise_init (&adv) != 0)
{
/* the only failure of lt_dladvise_init() seems to be caused
* by memory allocation failured */
qse_awk_seterrnum (awk, QSE_AWK_ENOMEM, QSE_NULL);
return QSE_NULL;
}
lt_dladvise_ext (&adv);
/*lt_dladvise_resident (&adv); useful for debugging with valgrind */
h = lt_dlopenadvise (modpath, adv);
lt_dladvise_destroy (&adv);
QSE_MMGR_FREE (awk->mmgr, modpath); QSE_MMGR_FREE (awk->mmgr, modpath);