diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-16 21:09:46 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-16 21:09:46 +0000 |
commit | dbec3d56c146801fad339a1d46a388865b18ffb4 (patch) | |
tree | 8fda811f62cb6ffb99847befb7b74b1519ea95ba /res/res_smdi.c | |
parent | 0fb9c73a989207650aa3ba603824e4593809611b (diff) |
Don't reload a configuration file if nothing has changed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
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 |