From: Sean Bright Date: Thu, 27 Sep 2018 20:01:58 +0000 (-0400) Subject: config.c: Cleanup AST_INCLUDE_GLOB X-Git-Tag: 17.0.0-rc1~350^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac23e5ad482c87247d23250dc605689dcf546715;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 d0447fcd3b..1961b24fe5 100644 --- a/main/config.c +++ b/main/config.c @@ -48,8 +48,6 @@ #include /* HUGE_VAL */ #include -#define AST_INCLUDE_GLOB 1 - #include "asterisk/config.h" #include "asterisk/cli.h" #include "asterisk/lock.h" @@ -2047,10 +2045,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); @@ -2073,7 +2069,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) { @@ -2101,7 +2097,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 { @@ -3153,29 +3143,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);