summaryrefslogtreecommitdiff
path: root/source4/lib/com
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-30 22:46:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:06 -0500
commitaa9f67163cd2df2a815ef585edad1951343b82c8 (patch)
tree88058f98a5681563c745a9e3239469b61e11648f /source4/lib/com
parent5a26b2d72b63f0b3d8d4aa151044521fdf8c2064 (diff)
downloadsamba-aa9f67163cd2df2a815ef585edad1951343b82c8.tar.gz
samba-aa9f67163cd2df2a815ef585edad1951343b82c8.tar.bz2
samba-aa9f67163cd2df2a815ef585edad1951343b82c8.zip
r12620: Get rid of automatically generated lists of init functions of subsystems.
This allows Samba libraries to be used by other projects (and parts of Samba to be built as shared libraries). (This used to be commit 44f0aba715bfedc7e1ee3d07e9a101a91dbd84b3)
Diffstat (limited to 'source4/lib/com')
-rw-r--r--source4/lib/com/config.mk1
-rw-r--r--source4/lib/com/main.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/source4/lib/com/config.mk b/source4/lib/com/config.mk
index 9e66502046..12f0481b0f 100644
--- a/source4/lib/com/config.mk
+++ b/source4/lib/com/config.mk
@@ -1,5 +1,4 @@
[SUBSYSTEM::COM]
-INIT_FUNCTION = com_init
OBJ_FILES = \
tables.o \
rot.o \
diff --git a/source4/lib/com/main.c b/source4/lib/com/main.c
index 123ba49b09..f2e4f6473a 100644
--- a/source4/lib/com/main.c
+++ b/source4/lib/com/main.c
@@ -92,8 +92,15 @@ WERROR com_get_class_object(struct com_context *ctx, struct GUID *clsid, struct
NTSTATUS com_init(void)
{
- init_module_fn static_init[] = STATIC_COM_MODULES;
- init_module_fn *shared_init = load_samba_modules(NULL, "com");
+ static BOOL initialized = False;
+
+ init_module_fn static_init[] = STATIC_COM_MODULES;
+ init_module_fn *shared_init;
+
+ if (initialized) return NT_STATUS_OK;
+ initialized = True;
+
+ shared_init = load_samba_modules(NULL, "com");
run_init_functions(static_init);
run_init_functions(shared_init);