1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

- Remove RTLD_GLOBAL

- make smb_load_module() return the return value of init_module()
(This used to be commit a8d2dd8d00)
This commit is contained in:
Jelmer Vernooij 2002-10-30 12:07:49 +00:00
parent 809f740166
commit 04d21551e1
2 changed files with 5 additions and 4 deletions

View 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 */

View 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 */