summaryrefslogtreecommitdiff
path: root/source3/lib/module.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-11-30 01:01:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:27 -0500
commit93435b50961018c1710f4ce1acb715dc2b1a6dcb (patch)
tree7064f2cf7114b22de15bd09cc741bdcee131466d /source3/lib/module.c
parent46f546571bc2429c4ee6ef86866520c4b5d4bcc7 (diff)
downloadsamba-93435b50961018c1710f4ce1acb715dc2b1a6dcb.tar.gz
samba-93435b50961018c1710f4ce1acb715dc2b1a6dcb.tar.bz2
samba-93435b50961018c1710f4ce1acb715dc2b1a6dcb.zip
r4009: Fix from Timur Bakeyev <timur@com.bat.ru> for bugid #2100,
change the way we check for errors after a dlopen (which may set internal warnings which get picked up by mistake in dlsym). Jeremy (This used to be commit 6711cb8b02f96d04af82d30b1274f76dc5461dc2)
Diffstat (limited to 'source3/lib/module.c')
-rw-r--r--source3/lib/module.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/lib/module.c b/source3/lib/module.c
index 2abe918ef4..e469b1da42 100644
--- a/source3/lib/module.c
+++ b/source3/lib/module.c
@@ -40,9 +40,12 @@ static NTSTATUS do_smb_load_module(const char *module_name, BOOL is_probe)
*/
handle = sys_dlopen(module_name, RTLD_LAZY);
+ /* This call should reset any possible non-fatal errors that
+ occured since last call to dl* functions */
+ error = sys_dlerror();
+
if(!handle) {
int level = is_probe ? 3 : 0;
- error = sys_dlerror();
DEBUG(level, ("Error loading module '%s': %s\n", module_name, error ? error : ""));
return NT_STATUS_UNSUCCESSFUL;
}