Skip to content
Snippets Groups Projects
Commit 7bf4fc6c authored by Jason Parker's avatar Jason Parker
Browse files

Only reload if the config file has changed.

Closes issue #11281, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 6b08c442
No related branches found
No related tags found
No related merge requests found
...@@ -1012,18 +1012,19 @@ static void init_state(void) ...@@ -1012,18 +1012,19 @@ static void init_state(void)
alignment = ADSI_JUST_CENT; alignment = ADSI_JUST_CENT;
} }
static void adsi_load(void) static void adsi_load(int reload)
{ {
int x = 0; int x = 0;
struct ast_config *conf = NULL; struct ast_config *conf = NULL;
struct ast_variable *v; struct ast_variable *v;
struct ast_flags config_flags = { 0 }; struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
char *name, *sname; char *name, *sname;
init_state(); init_state();
if (!(conf = ast_config_load("adsi.conf", config_flags))) if (!(conf = ast_config_load("adsi.conf", config_flags)))
return; return;
else if (conf == CONFIG_STATUS_FILEUNCHANGED)
return;
for (v = ast_variable_browse(conf, "intro"); v; v = v->next) { for (v = ast_variable_browse(conf, "intro"); v; v = v->next) {
if (!strcasecmp(v->name, "alignment")) if (!strcasecmp(v->name, "alignment"))
alignment = str2align(v->value); alignment = str2align(v->value);
...@@ -1066,13 +1067,13 @@ static void adsi_load(void) ...@@ -1066,13 +1067,13 @@ static void adsi_load(void)
static int reload(void) static int reload(void)
{ {
adsi_load(); adsi_load(1);
return 0; return 0;
} }
static int load_module(void) static int load_module(void)
{ {
adsi_load(); adsi_load(0);
ast_adsi_begin_download = _ast_adsi_begin_download; ast_adsi_begin_download = _ast_adsi_begin_download;
ast_adsi_end_download = _ast_adsi_end_download; ast_adsi_end_download = _ast_adsi_end_download;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment