aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_followme.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 /apps/app_followme.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 'apps/app_followme.c')
-rw-r--r--apps/app_followme.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/app_followme.c b/apps/app_followme.c
index f81472e6d..1a697e526 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -275,7 +275,7 @@ static struct number *create_followme_number(char *number, int timeout, int numo
}
/*! \brief Reload followme application module */
-static int reload_followme(void)
+static int reload_followme(int reload)
{
struct call_followme *f;
struct ast_config *cfg;
@@ -289,11 +289,13 @@ static int reload_followme(void)
const char *takecallstr;
const char *declinecallstr;
const char *tmpstr;
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
- if (!(cfg = ast_config_load("followme.conf"))) {
+ if (!(cfg = ast_config_load("followme.conf", config_flags))) {
ast_log(LOG_WARNING, "No follow me config file (followme.conf), so no follow me\n");
return 0;
- }
+ } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
AST_RWLIST_WRLOCK(&followmes);
@@ -1051,7 +1053,7 @@ static int unload_module(void)
static int load_module(void)
{
- if(!reload_followme())
+ if(!reload_followme(0))
return AST_MODULE_LOAD_DECLINE;
return ast_register_application(app, app_exec, synopsis, descrip);
@@ -1059,7 +1061,7 @@ static int load_module(void)
static int reload(void)
{
- reload_followme();
+ reload_followme(1);
return 0;
}