Przeglądaj źródła

app_perl: do dlerror() after dlsym() fails to find exports

- some OSes do not reset dlerror after a successful dlsym(), pointing to
an older error case
- reported by GH #1465

(cherry picked from commit 795edca9215391f7c8f646895c083f8ac8853341)
(cherry picked from commit 48c8f7751d701c8a6dd538280c5c1fa6129d141d)
Daniel-Constantin Mierla 7 lat temu
rodzic
commit
a126490fca
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      src/core/sr_module.c

+ 3 - 0
src/core/sr_module.c

@@ -619,6 +619,9 @@ reload:
 	}
 	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) {