summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-24 01:28:22 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-24 01:51:07 -0600
commitc13ae707313c5bf9819a75c1699d099565d2494d (patch)
tree9bc499e9ec34156cb7d3f58601fb41b7a92c5f61 /source4
parentac267899b49567b677289a23e83c09d19b1bdb3b (diff)
downloadsamba-c13ae707313c5bf9819a75c1699d099565d2494d.tar.gz
samba-c13ae707313c5bf9819a75c1699d099565d2494d.tar.bz2
samba-c13ae707313c5bf9819a75c1699d099565d2494d.zip
r26580: Include sentinel in build.h, in case the list is empty.
(This used to be commit f1997dabed584bdc864c4b7235c29603c312ef46)
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/auth.c2
-rw-r--r--source4/auth/gensec/gensec.c2
-rw-r--r--source4/build/smb_build/config_mk.pm4
-rw-r--r--source4/build/smb_build/header.pm3
-rw-r--r--source4/build/smb_build/input.pm10
-rw-r--r--source4/lib/events/events.c2
-rw-r--r--source4/lib/ldb/common/ldb_modules.c5
-rw-r--r--source4/ntptr/ntptr_base.c2
-rw-r--r--source4/ntvfs/ntvfs_base.c2
-rw-r--r--source4/ntvfs/sysdep/sys_notify.c2
-rw-r--r--source4/param/share.c2
-rw-r--r--source4/rpc_server/service_rpc.c2
-rw-r--r--source4/scripting/ejs/smbcalls.c2
-rw-r--r--source4/scripting/python/config.mk1
-rw-r--r--source4/smbd/process_model.c2
-rw-r--r--source4/smbd/server.c2
-rw-r--r--source4/torture/torture.c2
17 files changed, 27 insertions, 20 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c
index 4bfc92e8f9..ed590f2ced 100644
--- a/source4/auth/auth.c
+++ b/source4/auth/auth.c
@@ -516,7 +516,7 @@ NTSTATUS auth_init(void)
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_auth_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_auth_MODULES };
if (initialized) return NT_STATUS_OK;
initialized = true;
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index 6f7ff91db6..cd2066d9fd 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -1268,7 +1268,7 @@ NTSTATUS gensec_init(struct loadparm_context *lp_ctx)
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_gensec_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_gensec_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 4f231c0356..7ad6600a8c 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -44,7 +44,8 @@ my $section_types = {
"CFLAGS" => "list",
"LDFLAGS" => "list",
- "STANDARD_VISIBILITY" => "string"
+ "STANDARD_VISIBILITY" => "string",
+ "INIT_FUNCTION_SENTINEL" => "string"
},
"MODULE" => {
"SUBSYSTEM" => "string",
@@ -88,6 +89,7 @@ my $section_types = {
"LIBRARY_REALNAME" => "string",
"INIT_FUNCTION_TYPE" => "string",
+ "INIT_FUNCTION_SENTINEL" => "string",
"OUTPUT_TYPE" => "list",
"OBJ_FILES" => "list",
diff --git a/source4/build/smb_build/header.pm b/source4/build/smb_build/header.pm
index b0dced4897..b52464922b 100644
--- a/source4/build/smb_build/header.pm
+++ b/source4/build/smb_build/header.pm
@@ -44,13 +44,12 @@ sub _prepare_build_h($)
$DEFINE->{VAL} .= "\t$_, \\\n";
unless (/{/) {
my $fn = $key->{INIT_FUNCTION_TYPE};
- unless(defined($fn)) { $fn = "NTSTATUS (*) (void)"; }
$fn =~ s/\(\*\)/$_/;
$output .= "$fn;\n";
}
}
- $DEFINE->{VAL} =~ s/, \\\n$//g; # Remove the last comma
+ $DEFINE->{VAL} .= "\t$key->{INIT_FUNCTION_SENTINEL} \n";
push(@defines,$DEFINE);
}
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index ae37a7602b..6d5c4f4a1e 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -63,6 +63,10 @@ sub check_subsystem($$$)
unless(defined($subsys->{OUTPUT_TYPE})) {
$subsys->{OUTPUT_TYPE} = $default_ot;
}
+
+ unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; }
+ unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; }
+
add_libreplace($subsys);
}
@@ -136,9 +140,9 @@ sub check_library($$$)
return;
}
- unless (defined($lib->{INIT_FUNCTION_TYPE})) {
- $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)";
- }
+ unless (defined($lib->{INIT_FUNCTION_TYPE})) { $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; }
+
+ unless (defined($lib->{INIT_FUNCTION_SENTINEL})) { $lib->{INIT_FUNCTION_SENTINEL} = "NULL"; }
unless(defined($lib->{INSTALLDIR})) {
$lib->{INSTALLDIR} = "LIBDIR";
diff --git a/source4/lib/events/events.c b/source4/lib/events/events.c
index db7c3a5066..245be14326 100644
--- a/source4/lib/events/events.c
+++ b/source4/lib/events/events.c
@@ -102,7 +102,7 @@ void event_set_default_backend(const char *backend)
static void event_backend_init(void)
{
#if _SAMBA_BUILD_
- init_module_fn static_init[] = { STATIC_LIBEVENTS_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_LIBEVENTS_MODULES };
init_module_fn *shared_init;
if (event_backends) return;
shared_init = load_samba_modules(NULL, global_loadparm, "events");
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 4e70b177bc..18070bdb86 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -160,12 +160,13 @@ static const struct ldb_module_ops *ldb_find_module_ops(const char *name)
ldb_rdn_name_init, \
ldb_paged_results_init, \
ldb_sort_init, \
- ldb_asq_init
+ ldb_asq_init, \
+ NULL
#endif
int ldb_global_init(void)
{
- int (*static_init_fns[])(void) = { STATIC_LIBLDB_MODULES, NULL };
+ int (*static_init_fns[])(void) = { STATIC_LIBLDB_MODULES };
static int initialized = 0;
int ret = 0, i;
diff --git a/source4/ntptr/ntptr_base.c b/source4/ntptr/ntptr_base.c
index 275f204524..26e192d64b 100644
--- a/source4/ntptr/ntptr_base.c
+++ b/source4/ntptr/ntptr_base.c
@@ -71,7 +71,7 @@ NTSTATUS ntptr_register(const void *_ops)
NTSTATUS ntptr_init(struct loadparm_context *lp_ctx)
{
- init_module_fn static_init[] = { STATIC_ntptr_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_ntptr_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "ntptr");
run_init_functions(static_init);
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c
index d4ae6c8b4f..f5a24f23a0 100644
--- a/source4/ntvfs/ntvfs_base.c
+++ b/source4/ntvfs/ntvfs_base.c
@@ -202,7 +202,7 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e
NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_ntvfs_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_ntvfs_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c
index a6d0a698bc..2ed9908af7 100644
--- a/source4/ntvfs/sysdep/sys_notify.c
+++ b/source4/ntvfs/sysdep/sys_notify.c
@@ -125,7 +125,7 @@ _PUBLIC_ NTSTATUS sys_notify_init(void)
{
static bool initialized = false;
- init_module_fn static_init[] = { STATIC_sys_notify_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
diff --git a/source4/param/share.c b/source4/param/share.c
index edbb68b5f0..2c97625bcc 100644
--- a/source4/param/share.c
+++ b/source4/param/share.c
@@ -146,7 +146,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name
*/
NTSTATUS share_init(void)
{
- init_module_fn static_init[] = { STATIC_share_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_share_MODULES };
run_init_functions(static_init);
diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c
index 0483736912..46b869ad71 100644
--- a/source4/rpc_server/service_rpc.c
+++ b/source4/rpc_server/service_rpc.c
@@ -467,7 +467,7 @@ static NTSTATUS dcesrv_init(struct event_context *event_context,
NTSTATUS server_service_rpc_init(void)
{
- init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "dcerpc_server");
run_init_functions(static_init);
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index da13f1f6ef..1f29fce002 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -173,7 +173,7 @@ _PUBLIC_ void ejs_exception(const char *reason)
*/
void smb_setup_ejs_functions(void (*exception_handler)(const char *))
{
- init_module_fn static_init[] = { STATIC_smbcalls_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_smbcalls_MODULES };
init_module_fn *shared_init;
ejs_exception_handler = exception_handler;
diff --git a/source4/scripting/python/config.mk b/source4/scripting/python/config.mk
index 601e432906..226f9637db 100644
--- a/source4/scripting/python/config.mk
+++ b/source4/scripting/python/config.mk
@@ -4,6 +4,7 @@ OBJ_FILES = smbpython.o
[SUBSYSTEM::LIBPYTHON]
PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON
+INIT_FUNCTION_SENTINEL = { NULL, NULL }
OBJ_FILES = modules.o
[PYTHON::python_uuid]
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index dc3ede613c..8939637c3f 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -82,7 +82,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops)
NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
{
- init_module_fn static_init[] = { STATIC_process_model_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_process_model_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
run_init_functions(static_init);
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 78892b6760..c256eed96c 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -187,7 +187,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
bool opt_interactive = false;
int opt;
poptContext pc;
- init_module_fn static_init[] = { STATIC_service_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_service_MODULES };
init_module_fn *shared_init;
struct event_context *event_ctx;
NTSTATUS status;
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 6bce38363e..b471135ce1 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -64,7 +64,7 @@ struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx,
int torture_init(void)
{
- init_module_fn static_init[] = { STATIC_torture_MODULES, NULL };
+ init_module_fn static_init[] = { STATIC_torture_MODULES };
init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "torture");
run_init_functions(static_init);