From: Alan T. DeKok Date: Sun, 6 May 2018 21:32:42 +0000 (-0400) Subject: explicitly call dl_init() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ff4d776751641038dee46733ebbeb129ca99e64;p=thirdparty%2Ffreeradius-server.git explicitly call dl_init() --- diff --git a/src/include/dl.h b/src/include/dl.h index e2a2d37c204..eaace2bdf45 100644 --- a/src/include/dl.h +++ b/src/include/dl.h @@ -166,6 +166,8 @@ struct dl_instance { #define DL_INSTANTIATE_PRIORITY 5 //!< Callback priority for bootstrap callback +int dl_init(void); + int dl_symbol_init_cb_register(unsigned int priority, char const *symbol, dl_init_t func, void *ctx); diff --git a/src/main/dl.c b/src/main/dl.c index cf5588bf09f..c55ad7b44a6 100644 --- a/src/main/dl.c +++ b/src/main/dl.c @@ -119,8 +119,6 @@ static FR_NAME_NUMBER const dl_type_prefix[] = { { NULL , -1 }, }; -static int dl_init(void); - static int dl_symbol_init_cmp(void const *one, void const *two) { dl_symbol_init_t const *a = one, *b = two; @@ -684,8 +682,6 @@ dl_t const *dl_module(CONF_SECTION *conf, dl_t const *parent, char const *name, char *p, *q; dl_common_t const *module; - if (!dl) dl_init(); - if (parent) { module_name = talloc_typed_asprintf(NULL, "%s_%s_%s", fr_int2str(dl_type_prefix, parent->type, ""), @@ -894,7 +890,7 @@ int dl_instance(TALLOC_CTX *ctx, dl_instance_t **out, /** Initialise structures needed by the dynamic linker * */ -static int dl_init(void) +int dl_init(void) { if (dl) return 0; diff --git a/src/main/radiusd.c b/src/main/radiusd.c index 15945220ce6..c588367caf8 100644 --- a/src/main/radiusd.c +++ b/src/main/radiusd.c @@ -395,6 +395,12 @@ int main(int argc, char *argv[]) */ if (main_config.daemonize) main_config.write_pid = true; + /* + * Initialize the DL infrastructure, which is used by the + * config file parser. + */ + dl_init(); + /* * Read the configuration files, BEFORE doing anything else. */