r4009: Fix from Timur Bakeyev <timur@com.bat.ru> for bugid #2100,
authorJeremy Allison <jra@samba.org>
Tue, 30 Nov 2004 01:01:43 +0000 (01:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:27 +0000 (10:53 -0500)
change the way we check for errors after a dlopen (which
may set internal warnings which get picked up by mistake
in dlsym).
Jeremy

source/lib/module.c

index 2abe918ef44c8b07d2b48508ca629a237934b4f9..e469b1da422102450abcea78f7af48f94bf0b5e1 100644 (file)
@@ -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;
        }