- Remove RTLD_GLOBAL
authorJelmer Vernooij <jelmer@samba.org>
Wed, 30 Oct 2002 12:07:49 +0000 (12:07 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 30 Oct 2002 12:07:49 +0000 (12:07 +0000)
- make smb_load_module() return the return value of init_module()

source/include/smb.h
source/lib/module.c

index 65a75420fca603e8cd2d3e53dbba24c267c13dc4..42b8113e5904c32831ae5f33c0b695bf6096afee 100644 (file)
@@ -1698,6 +1698,6 @@ extern struct poptOption popt_common_debug[];
 extern struct poptOption popt_common_configfile[];
 
 /* Module support */
-typedef int (init_module_function) (void);
+typedef NTSTATUS (init_module_function) (void);
 
 #endif /* _SMB_H */
index e4d22e0bb7d1f0af75480aa24b627bc79d14dc61..0953f53ad3eee9dcc47b20ad47d25529ed337185 100644 (file)
@@ -26,12 +26,13 @@ NTSTATUS smb_load_module(const char *module_name)
 {
        void *handle;
        init_module_function *init;
+       NTSTATUS nt_status;
 
        /* Always try to use LAZY symbol resolving; if the plugin has 
         * backwards compatibility, there might be symbols in the 
         * plugin referencing to old (removed) functions
         */
-       handle = dlopen(module_name, RTLD_LAZY | RTLD_GLOBAL);
+       handle = dlopen(module_name, RTLD_LAZY);
 
        if(!handle) {
                DEBUG(0, ("Error loading module '%s': %s\n", module_name, sys_dlerror()));
@@ -45,11 +46,11 @@ NTSTATUS smb_load_module(const char *module_name)
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       init();
+       nt_status = init();
 
        DEBUG(2, ("Module '%s' loaded\n", module_name));
 
-       return NT_STATUS_OK;
+       return nt_status;
 }
 
 #else /* HAVE_DLOPEN */