diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-08-16 21:09:46 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-08-16 21:09:46 +0000 |
commit | 56b9568164b694a42e88f1f8a31012078b833203 (patch) | |
tree | 8fda811f62cb6ffb99847befb7b74b1519ea95ba /res/res_smdi.c | |
parent | c0060cd99a0a318b504da4c13eee85f3b9043fdc (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 'res/res_smdi.c')
-rw-r--r-- | res/res_smdi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c index f1f1b193e..01a6404a2 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -513,6 +513,7 @@ static int smdi_load(int reload) struct ast_config *conf; struct ast_variable *v; struct ast_smdi_interface *iface = NULL; + struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; int res = 0; /* Config options */ @@ -524,13 +525,14 @@ static int smdi_load(int reload) int msdstrip = 0; /* strip zero digits */ long msg_expiry = SMDI_MSG_EXPIRY_TIME; - if (!(conf = ast_config_load(config_file))) { + if (!(conf = ast_config_load(config_file, config_flags))) { if (reload) ast_log(LOG_NOTICE, "Unable to reload config %s: SMDI untouched\n", config_file); else ast_log(LOG_NOTICE, "Unable to load config %s: SMDI disabled\n", config_file); return 1; - } + } else if (conf == CONFIG_STATUS_FILEUNCHANGED) + return 0; /* Mark all interfaces that we are listening on. We will unmark them * as we find them in the config file, this way we know any interfaces |