summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-10-30 12:07:49 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-10-30 12:07:49 +0000
commita8d2dd8d009797486105188f8fdb898a65bb25b0 (patch)
treefd82ec4f9e77648057b03486ddd84ddb6251eb83
parent732bc4519f1119100607cc84400e8f84e0c0ba9d (diff)
downloadsamba-a8d2dd8d009797486105188f8fdb898a65bb25b0.tar.gz
samba-a8d2dd8d009797486105188f8fdb898a65bb25b0.tar.xz
samba-a8d2dd8d009797486105188f8fdb898a65bb25b0.zip
- Remove RTLD_GLOBAL
- make smb_load_module() return the return value of init_module()
-rw-r--r--source/include/smb.h2
-rw-r--r--source/lib/module.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/source/include/smb.h b/source/include/smb.h
index 65a75420fca..42b8113e590 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -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 */
diff --git a/source/lib/module.c b/source/lib/module.c
index e4d22e0bb7d..0953f53ad3e 100644
--- a/source/lib/module.c
+++ b/source/lib/module.c
@@ -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 */