Skip to content

Commit

Permalink
app_perl: do dlerror() after dlsym() fails to find exports
Browse files Browse the repository at this point in the history
- some OSes do not reset dlerror after a successful dlsym(), pointing to
an older error case
- reported by GH #1465
  • Loading branch information
miconda committed Mar 5, 2018
1 parent 2c828e1 commit 795edca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/sr_module.c
Expand Up @@ -619,6 +619,9 @@ int load_module(char* mod_path)
}
exp = (union module_exports_u*)dlsym(handle, "exports");
if(exp==NULL) {
error =(char*)dlerror();
LM_DBG("attempt to lookup exports structure failed - dlerror: %s\n",
(error)?error:"none");
/* 'exports' structure not found, look up for '_modulename_exports' */
mdir = strrchr(mod_path, '/');
if (!mdir) {
Expand Down

0 comments on commit 795edca

Please sign in to comment.