summaryrefslogtreecommitdiff
path: root/funcs
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 /funcs
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 'funcs')
-rw-r--r--funcs/func_odbc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index 856c5c288..ee80fcc98 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -746,12 +746,13 @@ static int load_module(void)
int res = 0;
struct ast_config *cfg;
char *catg;
+ struct ast_flags config_flags = { 0 };
res |= ast_custom_function_register(&fetch_function);
res |= ast_register_application(app_odbcfinish, exec_odbcfinish, syn_odbcfinish, desc_odbcfinish);
AST_LIST_LOCK(&queries);
- cfg = ast_config_load(config);
+ cfg = ast_config_load(config, config_flags);
if (!cfg) {
ast_log(LOG_NOTICE, "Unable to load config for func_odbc: %s\n", config);
AST_LIST_UNLOCK(&queries);
@@ -815,6 +816,11 @@ static int reload(void)
struct ast_config *cfg;
struct acf_odbc_query *oldquery;
char *catg;
+ struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };
+
+ cfg = ast_config_load(config, config_flags);
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
AST_LIST_LOCK(&queries);
@@ -824,7 +830,6 @@ static int reload(void)
free_acf_query(oldquery);
}
- cfg = ast_config_load(config);
if (!cfg) {
ast_log(LOG_WARNING, "Unable to load config for func_odbc: %s\n", config);
goto reload_out;