diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ael_main.c | 13 | ||||
-rw-r--r-- | utils/conf2ael.c | 11 | ||||
-rw-r--r-- | utils/extconf.c | 2 |
3 files changed, 12 insertions, 14 deletions
diff --git a/utils/ael_main.c b/utils/ael_main.c index 68b5dc479..7f20365f3 100644 --- a/utils/ael_main.c +++ b/utils/ael_main.c @@ -82,8 +82,11 @@ struct namelist *globalvars_last; int conts=0, extens=0, priors=0; char last_exten[18000]; -const char ast_config_AST_CONFIG_DIR[PATH_MAX]; -const char ast_config_AST_VAR_DIR[PATH_MAX]; + +static char config_dir[PATH_MAX]; +static char var_dir[PATH_MAX]; +const char *ast_config_AST_CONFIG_DIR = config_dir; +const char *ast_config_AST_VAR_DIR = var_dir; void ast_cli_register_multiple(void); int ast_add_extension2(struct ast_context *con, @@ -514,14 +517,14 @@ int main(int argc, char **argv) } if( use_curr_dir ) { - strcpy((char *)ast_config_AST_CONFIG_DIR, "."); + strcpy(config_dir, "."); localized_use_local_dir(); } else { - strcpy((char *)ast_config_AST_CONFIG_DIR, "/etc/asterisk"); + strcpy(config_dir, "/etc/asterisk"); localized_use_conf_dir(); } - strcpy((char *)ast_config_AST_VAR_DIR, "/var/lib/asterisk"); + strcpy(var_dir, "/var/lib/asterisk"); if( dump_extensions ) { dumpfile = fopen("extensions.conf.aeldump","w"); diff --git a/utils/conf2ael.c b/utils/conf2ael.c index b8cae75ec..fbb8aa3b6 100644 --- a/utils/conf2ael.c +++ b/utils/conf2ael.c @@ -29,19 +29,13 @@ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") -#include <stdio.h> -#include <sys/types.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> +#include "asterisk/paths.h" /* CONFIG_DIR */ #include <locale.h> #include <ctype.h> #if !defined(SOLARIS) && !defined(__CYGWIN__) #include <err.h> #endif -#include <errno.h> #include <regex.h> -#include <limits.h> #include "asterisk.h" #include "asterisk/pbx.h" @@ -59,11 +53,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pval.h" #include "asterisk/extconf.h" +const char *ast_config_AST_CONFIG_DIR = "/etc/asterisk"; /* placeholder */ + void get_start_stop(unsigned int *word, int bitsperword, int totalbits, int *start, int *end); int all_bits_set(unsigned int *word, int bitsperword, int totalbits); extern char *days[]; extern char *months[]; -const char ast_config_AST_CONFIG_DIR[PATH_MAX]; char *config = "extensions.conf"; diff --git a/utils/extconf.c b/utils/extconf.c index 4621e345b..a64258cd9 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -25,6 +25,7 @@ */ #include "asterisk/compat.h" +#include "asterisk/paths.h" /* we use AST_CONFIG_DIR */ #include <errno.h> #include <time.h> @@ -53,7 +54,6 @@ # include <glob.h> #endif -static const char ast_config_AST_CONFIG_DIR[PATH_MAX] = {"/etc/asterisk"}; #define AST_API_MODULE 1 /* gimme the inline defs! */ struct ast_channel { |