[Asterisk-code-review] config.c: AST INCLUDE GLOB is always defined (asterisk[13])
Sean Bright
asteriskteam at digium.com
Thu Sep 27 15:02:07 CDT 2018
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/10300
Change subject: config.c: AST_INCLUDE_GLOB is always defined
......................................................................
config.c: AST_INCLUDE_GLOB is always defined
Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c
---
M main/config.c
1 file changed, 2 insertions(+), 10 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/10300/1
diff --git a/main/config.c b/main/config.c
index 12f8739..a8fae05 100644
--- a/main/config.c
+++ b/main/config.c
@@ -45,8 +45,6 @@
#include <math.h> /* HUGE_VAL */
#include <regex.h>
-#define AST_INCLUDE_GLOB 1
-
#include "asterisk/config.h"
#include "asterisk/cli.h"
#include "asterisk/lock.h"
@@ -2051,10 +2049,8 @@
/*! Growable string buffer */
struct ast_str *comment_buffer = NULL; /*!< this will be a comment collector.*/
struct ast_str *lline_buffer = NULL; /*!< A buffer for stuff behind the ; */
-#ifdef AST_INCLUDE_GLOB
int glob_ret;
glob_t globbuf;
-#endif
if (cfg) {
cat = ast_config_get_current_category(cfg);
@@ -2077,7 +2073,7 @@
return NULL;
}
}
-#ifdef AST_INCLUDE_GLOB
+
globbuf.gl_offs = 0; /* initialize it to silence gcc */
glob_ret = glob(fn, MY_GLOB_FLAGS, NULL, &globbuf);
if (glob_ret == GLOB_NOSPACE) {
@@ -2105,7 +2101,7 @@
}
for (i=0; i<globbuf.gl_pathc; i++) {
ast_copy_string(fn, globbuf.gl_pathv[i], sizeof(fn));
-#endif
+
/*
* The following is not a loop, but just a convenient way to define a block
* (using do { } while(0) ), and be able to exit from it with 'continue'
@@ -2164,9 +2160,7 @@
if (unchanged) {
AST_LIST_UNLOCK(&cfmtime_head);
-#ifdef AST_INCLUDE_GLOB
globfree(&globbuf);
-#endif
ast_free(comment_buffer);
ast_free(lline_buffer);
return CONFIG_STATUS_FILEUNCHANGED;
@@ -2340,14 +2334,12 @@
if (comment) {
ast_log(LOG_WARNING,"Unterminated comment detected beginning on line %d\n", nest[comment - 1]);
}
-#ifdef AST_INCLUDE_GLOB
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID) {
break;
}
}
globfree(&globbuf);
}
-#endif
ast_free(comment_buffer);
ast_free(lline_buffer);
--
To view, visit https://gerrit.asterisk.org/10300
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c
Gerrit-Change-Number: 10300
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180927/d42c7a2e/attachment.html>
More information about the asterisk-code-review
mailing list