Don't reload a configuration file if nothing has changed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-08-16 21:09:46 +00:00
parent c0060cd99a
commit 56b9568164
75 changed files with 881 additions and 561 deletions

View File

@@ -1063,7 +1063,7 @@ static void _fill_defaults (void)
void misdn_cfg_reload (void)
{
misdn_cfg_init (0);
misdn_cfg_init(0, 1);
}
void misdn_cfg_destroy (void)
@@ -1082,18 +1082,20 @@ void misdn_cfg_destroy (void)
ast_mutex_destroy(&config_mutex);
}
int misdn_cfg_init (int this_max_ports)
int misdn_cfg_init(int this_max_ports, int reload)
{
char config[] = "misdn.conf";
char *cat, *p;
int i;
struct ast_config *cfg;
struct ast_variable *v;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
if (!(cfg = AST_LOAD_CFG(config))) {
if (!(cfg = AST_LOAD_CFG(config, config_flags))) {
ast_log(LOG_WARNING, "missing file: misdn.conf\n");
return -1;
}
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
return 0;
ast_mutex_init(&config_mutex);