summaryrefslogtreecommitdiff
path: root/channels/misdn_config.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-08-16 21:09:46 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-08-16 21:09:46 +0000
commit56b9568164b694a42e88f1f8a31012078b833203 (patch)
tree8fda811f62cb6ffb99847befb7b74b1519ea95ba /channels/misdn_config.c
parentc0060cd99a0a318b504da4c13eee85f3b9043fdc (diff)
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
Diffstat (limited to 'channels/misdn_config.c')
-rw-r--r--channels/misdn_config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/channels/misdn_config.c b/channels/misdn_config.c
index bdd14370c..008f0f6e4 100644
--- a/channels/misdn_config.c
+++ b/channels/misdn_config.c
@@ -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);