r15356: Remove unused 'flags' argument from socket_send() and friends.
[bbaumbach/samba-autobuild/.git] / source4 / lib / com / main.c
index 123ba49b09fb74d958d56d829d48affeb0c734e3..3e4127f24698d9cfd903bd7d18877104061b8f77 100644 (file)
@@ -23,7 +23,7 @@
 #include "lib/com/com.h"
 #include "lib/events/events.h"
 #include "librpc/gen_ndr/com_dcom.h"
-#include "smb_build.h"
+#include "build.h"
 
 WERROR com_init_ctx(struct com_context **ctx, struct event_context *event_ctx)
 {
@@ -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);