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_odbc.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_odbc.c')
-rw-r--r-- | res/res_odbc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c index 6b70f16f6..c9d3ee700 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -213,10 +213,11 @@ static int load_odbc_config(void) char *cat, *dsn, *username, *password, *sanitysql; int enabled, pooling, limit; int connect = 0, res = 0; + struct ast_flags config_flags = { 0 }; struct odbc_class *new; - config = ast_config_load(cfg); + config = ast_config_load(cfg, config_flags); if (!config) { ast_log(LOG_WARNING, "Unable to load config file res_odbc.conf\n"); return -1; @@ -538,6 +539,7 @@ static int reload(void) char *cat, *dsn, *username, *password, *sanitysql; int enabled, pooling, limit; int connect = 0, res = 0; + struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED }; struct odbc_class *new, *class; struct odbc_obj *current; @@ -548,8 +550,8 @@ static int reload(void) class->delme = 1; } - config = ast_config_load(cfg); - if (config) { + config = ast_config_load(cfg, config_flags); + if (config != NULL && config != CONFIG_STATUS_FILEUNCHANGED) { for (cat = ast_category_browse(config, NULL); cat; cat=ast_category_browse(config, cat)) { if (!strcasecmp(cat, "ENV")) { for (v = ast_variable_browse(config, cat); v; v = v->next) { |