summaryrefslogtreecommitdiff
path: root/source4/lib/module.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-28 22:32:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:29 -0500
commit773f0ecf5ab07975b17f10448fb06af06905e8b7 (patch)
tree929e6146f14cb737e5862f818dd52af6ed0642dc /source4/lib/module.c
parenta4e7bf3a89a986f0055bb8b6c6890449ca405f39 (diff)
downloadsamba-773f0ecf5ab07975b17f10448fb06af06905e8b7.tar.gz
samba-773f0ecf5ab07975b17f10448fb06af06905e8b7.tar.bz2
samba-773f0ecf5ab07975b17f10448fb06af06905e8b7.zip
r11385: Fix issues in module.c. Calling function should pass in path
to directory rather then subsystem name now. (This used to be commit 2a868ab3b57f64a27416c7a24c8d1ae112fc0c53)
Diffstat (limited to 'source4/lib/module.c')
-rw-r--r--source4/lib/module.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source4/lib/module.c b/source4/lib/module.c
index b46d2b317c..2eb9f6e61e 100644
--- a/source4/lib/module.c
+++ b/source4/lib/module.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "system/dir.h"
static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
@@ -31,7 +30,7 @@ static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
path = talloc_asprintf(mem_ctx, "%s/%s", dir, name);
- handle = dlopen(path, 0);
+ handle = dlopen(path, RTLD_NOW);
if (handle == NULL) {
DEBUG(0, ("Unable to open %s: %s\n", path, dlerror()));
return False;
@@ -56,23 +55,16 @@ static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
return ret;
}
-BOOL load_modules(const char *subsystem)
+BOOL load_modules(const char *path)
{
DIR *dir;
struct dirent *entry;
- char *dir_path;
BOOL ret;
TALLOC_CTX *mem_ctx;
mem_ctx = talloc_init(NULL);
- dir_path = talloc_asprintf(mem_ctx, "%s/%s", dyn_LIBDIR, subsystem);
- if (!dir_path) {
- talloc_free(mem_ctx);
- return False;
- }
-
- dir = opendir(subsystem);
+ dir = opendir(path);
if (dir == NULL) {
talloc_free(mem_ctx);
return False;
@@ -82,7 +74,7 @@ BOOL load_modules(const char *subsystem)
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
continue;
- ret &= load_module(mem_ctx, dir_path, entry->d_name);
+ ret &= load_module(mem_ctx, path, entry->d_name);
}
closedir(dir);