mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
r26580: Include sentinel in build.h, in case the list is empty.
(This used to be commit f1997dabed
)
This commit is contained in:
parent
ac267899b4
commit
c13ae70731
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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";
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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]
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user