Use "init_shared_module" instead of "init_module" for initializing .so's
authorVolker Lendecke <vl@samba.org>
Fri, 20 Jun 2008 12:30:02 +0000 (14:30 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 21 Jun 2008 09:25:41 +0000 (11:25 +0200)
(This used to be commit 0c2fd687b25e32d446ef799927db6933bc61223d)

source3/lib/ldb/common/ldb_modules.c
source3/lib/module.c
source3/m4/aclocal.m4

index d898f3df03edab35d1eba37bb1a0c62f1825fffc..71a02205019c6bf998be789d2e7da21d04a3645c 100644 (file)
@@ -231,10 +231,12 @@ int ldb_try_load_dso(struct ldb_context *ldb, const char *name)
                return -1;
        }
 
-       init_fn = (int (*)(void))dlsym(handle, "init_module");
+       init_fn = (int (*)(void))dlsym(handle, "init_shared_module");
 
        if (init_fn == NULL) {
-               ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol `init_module' found in %s: %s\n", path, dlerror());
+               ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol "
+                         "`init_shared_module' found in %s: %s\n", path,
+                         dlerror());
                dlclose(handle);
                return -1;
        }
index 285bd9c4c07e32dc2963cb47556397d82926b767..dee0623094e85639d77e6c1f9d3e884afbc20c44 100644 (file)
@@ -49,14 +49,14 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       init = (init_module_function *)sys_dlsym(handle, "init_module");
+       init = (init_module_function *)sys_dlsym(handle, "init_shared_module");
 
        /* we must check sys_dlerror() to determine if it worked, because
            sys_dlsym() can validly return NULL */
        error = sys_dlerror();
        if (error) {
-               DEBUG(0, ("Error trying to resolve symbol 'init_module' in %s: %s\n", 
-                         module_name, error));
+               DEBUG(0, ("Error trying to resolve symbol 'init_shared_module' "
+                         "in %s: %s\n", module_name, error));
                sys_dlclose(handle);
                return NT_STATUS_UNSUCCESSFUL;
        }
index 48cdacc9c8ade0985e99fd84b578af046ecb8fa5..71b3b6965671316c902251c0918baadd80464631 100644 (file)
@@ -25,7 +25,7 @@ AC_DEFUN(SMB_MODULE,
        fi
        
        if test x"$DEST" = xSHARED; then
-               AC_DEFINE([$1][_init], [init_module], [Whether to build $1 as shared module])
+               AC_DEFINE([$1][_init], [init_shared_module], [Whether to build $1 as shared module])
                $4_MODULES="$$4_MODULES $3"
                AC_MSG_RESULT([shared])
                [$6]