From 56b9568164b694a42e88f1f8a31012078b833203 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Thu, 16 Aug 2007 21:09:46 +0000 Subject: 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 --- funcs/func_odbc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'funcs/func_odbc.c') 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; -- cgit v1.2.3