From: Sean Bright Date: Thu, 27 Sep 2018 20:01:58 +0000 (-0400) Subject: config.c: Cleanup AST_INCLUDE_GLOB X-Git-Tag: 15.7.0-rc1~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=066cade82bdf3107edd05b0289f036f25fd7d2e7;p=thirdparty%2Fasterisk.git config.c: Cleanup AST_INCLUDE_GLOB * In main/config.c, AST_INCLUDE_GLOB is fixed to '1' making the #ifdefs pointless. * In utils/extconf.c, AST_INCLUDE_GLOB is never defined so there is a lot of dead code. Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c --- diff --git a/main/config.c b/main/config.c index 69a66c649d..d41fadcb45 100644 --- a/main/config.c +++ b/main/config.c @@ -43,8 +43,6 @@ #include /* HUGE_VAL */ #include -#define AST_INCLUDE_GLOB 1 - #include "asterisk/config.h" #include "asterisk/cli.h" #include "asterisk/lock.h" @@ -2049,10 +2047,8 @@ static struct ast_config *config_text_file_load(const char *database, const char /*! 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); @@ -2075,7 +2071,7 @@ static struct ast_config *config_text_file_load(const char *database, const char 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) { @@ -2103,7 +2099,7 @@ static struct ast_config *config_text_file_load(const char *database, const char } for (i=0; i -#endif - #define AST_API_MODULE 1 /* gimme the inline defs! */ struct ast_channel { @@ -3379,29 +3369,6 @@ static struct ast_config *config_text_file_load(const char *database, const char CB_INIT(); } -#ifdef AST_INCLUDE_GLOB - { - int glob_ret; - glob_t globbuf; - - globbuf.gl_offs = 0; /* initialize it to silence gcc */ -#ifdef SOLARIS - glob_ret = glob(fn, GLOB_NOCHECK, NULL, &globbuf); -#else - glob_ret = glob(fn, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf); -#endif - if (glob_ret == GLOB_NOSPACE) - ast_log(LOG_WARNING, - "Glob Expansion of pattern '%s' failed: Not enough memory\n", fn); - else if (glob_ret == GLOB_ABORTED) - ast_log(LOG_WARNING, - "Glob Expansion of pattern '%s' failed: Read error\n", fn); - else { - /* loop over expanded files */ - int i; - for (i=0; iinclude_level == 1 && withcomments && comment_buffer) { if (comment_buffer) { free(comment_buffer);