aboutsummaryrefslogtreecommitdiffstats
path: root/dnsmgr.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-12 14:11:59 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-12 14:11:59 +0000
commit616c8e5dfc9ab92e773ac7ee6d0308d2a6043131 (patch)
tree1ca42c0be04ca7867cccaa0591a149b5c4b9e64a /dnsmgr.c
parent382d0f9e61523fab3feaebea8bf9eb036e098e05 (diff)
correct portability problem (don't look inside regex_t)
correct enable/disable option name to match sample config file git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5453 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'dnsmgr.c')
-rwxr-xr-xdnsmgr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dnsmgr.c b/dnsmgr.c
index 5afa776fe..d662ba2ed 100755
--- a/dnsmgr.c
+++ b/dnsmgr.c
@@ -55,6 +55,7 @@ static int refresh_interval;
struct refresh_info {
struct entry_list *entries;
int verbose;
+ unsigned int regex_present:1;
regex_t filter;
};
@@ -157,7 +158,7 @@ static int refresh_list(void *data)
ast_verbose(VERBOSE_PREFIX_2 "Refreshing DNS lookups.\n");
AST_LIST_LOCK(info->entries);
AST_LIST_TRAVERSE(info->entries, entry, list) {
- if (info->filter.used && regexec(&info->filter, entry->name, 0, NULL, 0))
+ if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0))
continue;
if (info->verbose && (option_verbose > 2))
@@ -200,11 +201,13 @@ static int handle_cli_refresh(int fd, int argc, char *argv[])
if (argc == 3) {
if (regcomp(&info.filter, argv[2], REG_EXTENDED | REG_NOSUB))
return RESULT_SHOWUSAGE;
+ else
+ info.regex_present = 1;
}
refresh_list(&info);
- if (info.filter.used)
+ if (info.regex_present)
regfree(&info.filter);
return 0;
@@ -297,7 +300,7 @@ static int do_reload(int loading)
ast_sched_del(sched, refresh_sched);
if ((config = ast_config_load("dnsmgr.conf"))) {
- if ((enabled_value = ast_variable_retrieve(config, "general", "enabled"))) {
+ if ((enabled_value = ast_variable_retrieve(config, "general", "enable"))) {
enabled = ast_true(enabled_value);
}
if ((interval_value = ast_variable_retrieve(config, "general", "refreshinterval"))) {