aboutsummaryrefslogtreecommitdiffstats
path: root/cdr/cdr_custom.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
commitdbec3d56c146801fad339a1d46a388865b18ffb4 (patch)
tree8fda811f62cb6ffb99847befb7b74b1519ea95ba /cdr/cdr_custom.c
parent0fb9c73a989207650aa3ba603824e4593809611b (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 'cdr/cdr_custom.c')
-rw-r--r--cdr/cdr_custom.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cdr/cdr_custom.c b/cdr/cdr_custom.c
index 80cd47ecf..fa4eb11c4 100644
--- a/cdr/cdr_custom.c
+++ b/cdr/cdr_custom.c
@@ -68,12 +68,16 @@ static int load_config(int reload)
{
struct ast_config *cfg;
struct ast_variable *var;
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
int res = -1;
+ if ((cfg = ast_config_load("cdr_custom.conf", config_flags)) == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
+
strcpy(format, "");
strcpy(master, "");
ast_mutex_lock(&lock);
- if((cfg = ast_config_load("cdr_custom.conf"))) {
+ if (cfg) {
var = ast_variable_browse(cfg, "mappings");
while(var) {
if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {