[asterisk-commits] [svn-commits] rizzo: trunk r93603 - in /trunk: channels/ include/asterisk/ main/ res/ utils/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 18 04:24:58 CST 2007


Author: rizzo
Date: Tue Dec 18 04:24:58 2007
New Revision: 93603

URL: http://svn.digium.com/view/asterisk?view=rev&rev=93603
Log:
make configuration variable const so they are not accidentally
modified.
This requires casting the strings in asterisk.c when writing to
them, so we do it through a macro to do it consistently.


Modified:
    trunk/channels/chan_sip.c
    trunk/include/asterisk/paths.h
    trunk/main/asterisk.c
    trunk/res/res_crypto.c
    trunk/res/res_monitor.c
    trunk/utils/ael_main.c
    trunk/utils/conf2ael.c
    trunk/utils/extconf.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Dec 18 04:24:58 2007
@@ -2907,7 +2907,7 @@
 	char regseconds[20];
 	char *tablename = NULL;
 
-	char *sysname = ast_config_AST_SYSTEM_NAME;
+	const char *sysname = ast_config_AST_SYSTEM_NAME;
 	char *syslabel = NULL;
 
 	time_t nowtime = time(NULL) + expirey;

Modified: trunk/include/asterisk/paths.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/paths.h?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/include/asterisk/paths.h (original)
+++ trunk/include/asterisk/paths.h Tue Dec 18 04:24:58 2007
@@ -17,27 +17,31 @@
 
 #ifndef _ASTERISK_PATHS_H
 #define _ASTERISK_PATHS_H
+#
+extern const char ast_config_AST_CONFIG_DIR[PATH_MAX];
+extern const char ast_config_AST_CONFIG_FILE[PATH_MAX];
+extern const char ast_config_AST_MODULE_DIR[PATH_MAX];
+extern const char ast_config_AST_SPOOL_DIR[PATH_MAX];
+extern const char ast_config_AST_MONITOR_DIR[PATH_MAX];
+extern const char ast_config_AST_VAR_DIR[PATH_MAX];
+extern const char ast_config_AST_DATA_DIR[PATH_MAX];
+extern const char ast_config_AST_LOG_DIR[PATH_MAX];
+extern const char ast_config_AST_AGI_DIR[PATH_MAX];
+extern const char ast_config_AST_DB[PATH_MAX];
+extern const char ast_config_AST_KEY_DIR[PATH_MAX];
+extern const char ast_config_AST_PID[PATH_MAX];
+extern const char ast_config_AST_SOCKET[PATH_MAX];
+extern const char ast_config_AST_RUN_DIR[PATH_MAX];
+extern const char ast_config_AST_RUN_GROUP[PATH_MAX];
+extern const char ast_config_AST_RUN_USER[PATH_MAX];
+extern const char ast_config_AST_SYSTEM_NAME[20];
 
-extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
-extern char ast_config_AST_CONFIG_FILE[PATH_MAX];
-extern char ast_config_AST_MODULE_DIR[PATH_MAX];
-extern char ast_config_AST_SPOOL_DIR[PATH_MAX];
-extern char ast_config_AST_MONITOR_DIR[PATH_MAX];
-extern char ast_config_AST_VAR_DIR[PATH_MAX];
-extern char ast_config_AST_DATA_DIR[PATH_MAX];
-extern char ast_config_AST_LOG_DIR[PATH_MAX];
-extern char ast_config_AST_AGI_DIR[PATH_MAX];
-extern char ast_config_AST_DB[PATH_MAX];
-extern char ast_config_AST_KEY_DIR[PATH_MAX];
-extern char ast_config_AST_PID[PATH_MAX];
-extern char ast_config_AST_SOCKET[PATH_MAX];
-extern char ast_config_AST_RUN_DIR[PATH_MAX];
-extern char ast_config_AST_RUN_GROUP[PATH_MAX];
-extern char ast_config_AST_RUN_USER[PATH_MAX];
-extern char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
-extern char ast_config_AST_CTL_OWNER[PATH_MAX];
-extern char ast_config_AST_CTL_GROUP[PATH_MAX];
-extern char ast_config_AST_CTL[PATH_MAX];
-extern char ast_config_AST_SYSTEM_NAME[20];
+#if 0 /* only used in main/asterisk.c */
+extern const char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
+extern const char ast_config_AST_CTL_OWNER[PATH_MAX];
+extern const char ast_config_AST_CTL_GROUP[PATH_MAX];
+extern const char ast_config_AST_CTL[PATH_MAX];
+#endif
+
 
 #endif /* _ASTERISK_PATHS_H */

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Tue Dec 18 04:24:58 2007
@@ -92,6 +92,7 @@
 #include <sys/loadavg.h>
 #endif
 
+#include "asterisk/paths.h"	/* we define here the variables so better agree on the prototype */
 #include "asterisk/network.h"
 #include "asterisk/cli.h"
 #include "asterisk/channel.h"
@@ -199,27 +200,27 @@
 static int ast_el_read_history(char *);
 static int ast_el_write_history(char *);
 
-char ast_config_AST_CONFIG_DIR[PATH_MAX];
-char ast_config_AST_CONFIG_FILE[PATH_MAX];
-char ast_config_AST_MODULE_DIR[PATH_MAX];
-char ast_config_AST_SPOOL_DIR[PATH_MAX];
-char ast_config_AST_MONITOR_DIR[PATH_MAX];
-char ast_config_AST_VAR_DIR[PATH_MAX];
-char ast_config_AST_DATA_DIR[PATH_MAX];
-char ast_config_AST_LOG_DIR[PATH_MAX];
-char ast_config_AST_AGI_DIR[PATH_MAX];
-char ast_config_AST_DB[PATH_MAX];
-char ast_config_AST_KEY_DIR[PATH_MAX];
-char ast_config_AST_PID[PATH_MAX];
-char ast_config_AST_SOCKET[PATH_MAX];
-char ast_config_AST_RUN_DIR[PATH_MAX];
-char ast_config_AST_RUN_USER[PATH_MAX];
-char ast_config_AST_RUN_GROUP[PATH_MAX];
-char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
-char ast_config_AST_CTL_OWNER[PATH_MAX] = "\0";
-char ast_config_AST_CTL_GROUP[PATH_MAX] = "\0";
-char ast_config_AST_CTL[PATH_MAX] = "asterisk.ctl";
-char ast_config_AST_SYSTEM_NAME[20] = "";
+const char ast_config_AST_CONFIG_DIR[PATH_MAX];
+const char ast_config_AST_CONFIG_FILE[PATH_MAX];
+const char ast_config_AST_MODULE_DIR[PATH_MAX];
+const char ast_config_AST_SPOOL_DIR[PATH_MAX];
+const char ast_config_AST_MONITOR_DIR[PATH_MAX];
+const char ast_config_AST_VAR_DIR[PATH_MAX];
+const char ast_config_AST_DATA_DIR[PATH_MAX];
+const char ast_config_AST_LOG_DIR[PATH_MAX];
+const char ast_config_AST_AGI_DIR[PATH_MAX];
+const char ast_config_AST_DB[PATH_MAX];
+const char ast_config_AST_KEY_DIR[PATH_MAX];
+const char ast_config_AST_PID[PATH_MAX];
+const char ast_config_AST_SOCKET[PATH_MAX];
+const char ast_config_AST_RUN_DIR[PATH_MAX];
+const char ast_config_AST_RUN_USER[PATH_MAX];
+const char ast_config_AST_RUN_GROUP[PATH_MAX];
+static const char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
+static const char ast_config_AST_CTL_OWNER[PATH_MAX] = "\0";
+static const char ast_config_AST_CTL_GROUP[PATH_MAX] = "\0";
+static const char ast_config_AST_CTL[PATH_MAX] = "asterisk.ctl";
+const char ast_config_AST_SYSTEM_NAME[20] = "";
 
 extern const char *ast_build_hostname;
 extern const char *ast_build_kernel;
@@ -2419,19 +2420,20 @@
 		cfg = ast_config_load(config, config_flags);
 
 	/* init with buildtime config */
-	ast_copy_string(ast_config_AST_CONFIG_DIR, DEFAULT_CONFIG_DIR, sizeof(ast_config_AST_CONFIG_DIR));
-	ast_copy_string(ast_config_AST_SPOOL_DIR, DEFAULT_SPOOL_DIR, sizeof(ast_config_AST_SPOOL_DIR));
-	ast_copy_string(ast_config_AST_MODULE_DIR, DEFAULT_MODULE_DIR, sizeof(ast_config_AST_MODULE_DIR));
- 	snprintf(ast_config_AST_MONITOR_DIR, sizeof(ast_config_AST_MONITOR_DIR) - 1, "%s/monitor", ast_config_AST_SPOOL_DIR);
-	ast_copy_string(ast_config_AST_VAR_DIR, DEFAULT_VAR_DIR, sizeof(ast_config_AST_VAR_DIR));
-	ast_copy_string(ast_config_AST_DATA_DIR, DEFAULT_DATA_DIR, sizeof(ast_config_AST_DATA_DIR));
-	ast_copy_string(ast_config_AST_LOG_DIR, DEFAULT_LOG_DIR, sizeof(ast_config_AST_LOG_DIR));
-	ast_copy_string(ast_config_AST_AGI_DIR, DEFAULT_AGI_DIR, sizeof(ast_config_AST_AGI_DIR));
-	ast_copy_string(ast_config_AST_DB, DEFAULT_DB, sizeof(ast_config_AST_DB));
-	ast_copy_string(ast_config_AST_KEY_DIR, DEFAULT_KEY_DIR, sizeof(ast_config_AST_KEY_DIR));
-	ast_copy_string(ast_config_AST_PID, DEFAULT_PID, sizeof(ast_config_AST_PID));
-	ast_copy_string(ast_config_AST_SOCKET, DEFAULT_SOCKET, sizeof(ast_config_AST_SOCKET));
-	ast_copy_string(ast_config_AST_RUN_DIR, DEFAULT_RUN_DIR, sizeof(ast_config_AST_RUN_DIR));
+#define _SETVAR(dst, src)	ast_copy_string((char *)dst, src, sizeof(dst))
+	_SETVAR(ast_config_AST_CONFIG_DIR, DEFAULT_CONFIG_DIR);
+	_SETVAR(ast_config_AST_SPOOL_DIR, DEFAULT_SPOOL_DIR);
+	_SETVAR(ast_config_AST_MODULE_DIR, DEFAULT_MODULE_DIR);
+ 	snprintf((char *)ast_config_AST_MONITOR_DIR, sizeof(ast_config_AST_MONITOR_DIR) - 1, "%s/monitor", ast_config_AST_SPOOL_DIR);
+	_SETVAR(ast_config_AST_VAR_DIR, DEFAULT_VAR_DIR);
+	_SETVAR(ast_config_AST_DATA_DIR, DEFAULT_DATA_DIR);
+	_SETVAR(ast_config_AST_LOG_DIR, DEFAULT_LOG_DIR);
+	_SETVAR(ast_config_AST_AGI_DIR, DEFAULT_AGI_DIR);
+	_SETVAR(ast_config_AST_DB, DEFAULT_DB);
+	_SETVAR(ast_config_AST_KEY_DIR, DEFAULT_KEY_DIR);
+	_SETVAR(ast_config_AST_PID, DEFAULT_PID);
+	_SETVAR(ast_config_AST_SOCKET, DEFAULT_SOCKET);
+	_SETVAR(ast_config_AST_RUN_DIR, DEFAULT_RUN_DIR);
 
 	/* no asterisk.conf? no problem, use buildtime config! */
 	if (!cfg) {
@@ -2440,45 +2442,45 @@
 
 	for (v = ast_variable_browse(cfg, "files"); v; v = v->next) {
 		if (!strcasecmp(v->name, "astctlpermissions"))
-			ast_copy_string(ast_config_AST_CTL_PERMISSIONS, v->value, sizeof(ast_config_AST_CTL_PERMISSIONS));
+			_SETVAR(ast_config_AST_CTL_PERMISSIONS, v->value);
 		else if (!strcasecmp(v->name, "astctlowner"))
-			ast_copy_string(ast_config_AST_CTL_OWNER, v->value, sizeof(ast_config_AST_CTL_OWNER));
+			_SETVAR(ast_config_AST_CTL_OWNER, v->value);
 		else if (!strcasecmp(v->name, "astctlgroup"))
-			ast_copy_string(ast_config_AST_CTL_GROUP, v->value, sizeof(ast_config_AST_CTL_GROUP));
+			_SETVAR(ast_config_AST_CTL_GROUP, v->value);
 		else if (!strcasecmp(v->name, "astctl"))
-			ast_copy_string(ast_config_AST_CTL, v->value, sizeof(ast_config_AST_CTL));
+			_SETVAR(ast_config_AST_CTL, v->value);
 	}
 
 	for (v = ast_variable_browse(cfg, "directories"); v; v = v->next) {
 		if (!strcasecmp(v->name, "astetcdir")) {
-			ast_copy_string(ast_config_AST_CONFIG_DIR, v->value, sizeof(ast_config_AST_CONFIG_DIR));
+			_SETVAR(ast_config_AST_CONFIG_DIR, v->value);
 		} else if (!strcasecmp(v->name, "astspooldir")) {
-			ast_copy_string(ast_config_AST_SPOOL_DIR, v->value, sizeof(ast_config_AST_SPOOL_DIR));
-			snprintf(ast_config_AST_MONITOR_DIR, sizeof(ast_config_AST_MONITOR_DIR) - 1, "%s/monitor", v->value);
+			_SETVAR(ast_config_AST_SPOOL_DIR, v->value);
+			snprintf((char *)ast_config_AST_MONITOR_DIR, sizeof(ast_config_AST_MONITOR_DIR) - 1, "%s/monitor", v->value);
 		} else if (!strcasecmp(v->name, "astvarlibdir")) {
-			ast_copy_string(ast_config_AST_VAR_DIR, v->value, sizeof(ast_config_AST_VAR_DIR));
+			_SETVAR(ast_config_AST_VAR_DIR, v->value);
 			if (!found.dbdir)
-				snprintf(ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value);
+				snprintf((char *)ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value);
 		} else if (!strcasecmp(v->name, "astdbdir")) {
-			snprintf(ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value);
+			snprintf((char *)ast_config_AST_DB, sizeof(ast_config_AST_DB), "%s/astdb", v->value);
 			found.dbdir = 1;
 		} else if (!strcasecmp(v->name, "astdatadir")) {
-			ast_copy_string(ast_config_AST_DATA_DIR, v->value, sizeof(ast_config_AST_DATA_DIR));
+			_SETVAR(ast_config_AST_DATA_DIR, v->value);
 			if (!found.keydir)
-				snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
+				snprintf((char *)ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
 		} else if (!strcasecmp(v->name, "astkeydir")) {
-			snprintf(ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
+			snprintf((char *)ast_config_AST_KEY_DIR, sizeof(ast_config_AST_KEY_DIR), "%s/keys", v->value);
 			found.keydir = 1;
 		} else if (!strcasecmp(v->name, "astlogdir")) {
-			ast_copy_string(ast_config_AST_LOG_DIR, v->value, sizeof(ast_config_AST_LOG_DIR));
+			_SETVAR(ast_config_AST_LOG_DIR, v->value);
 		} else if (!strcasecmp(v->name, "astagidir")) {
-			ast_copy_string(ast_config_AST_AGI_DIR, v->value, sizeof(ast_config_AST_AGI_DIR));
+			_SETVAR(ast_config_AST_AGI_DIR, v->value);
 		} else if (!strcasecmp(v->name, "astrundir")) {
-			snprintf(ast_config_AST_PID, sizeof(ast_config_AST_PID), "%s/%s", v->value, "asterisk.pid");
-			snprintf(ast_config_AST_SOCKET, sizeof(ast_config_AST_SOCKET), "%s/%s", v->value, ast_config_AST_CTL);
-			ast_copy_string(ast_config_AST_RUN_DIR, v->value, sizeof(ast_config_AST_RUN_DIR));
+			snprintf((char *)ast_config_AST_PID, sizeof(ast_config_AST_PID), "%s/%s", v->value, "asterisk.pid");
+			snprintf((char *)ast_config_AST_SOCKET, sizeof(ast_config_AST_SOCKET), "%s/%s", v->value, ast_config_AST_CTL);
+			_SETVAR(ast_config_AST_RUN_DIR, v->value);
 		} else if (!strcasecmp(v->name, "astmoddir")) {
-			ast_copy_string(ast_config_AST_MODULE_DIR, v->value, sizeof(ast_config_AST_MODULE_DIR));
+			_SETVAR(ast_config_AST_MODULE_DIR, v->value);
 		}
 	}
 
@@ -2561,19 +2563,19 @@
 			set_ulimit(option_maxfiles);
 		/* What user to run as */
 		} else if (!strcasecmp(v->name, "runuser")) {
-			ast_copy_string(ast_config_AST_RUN_USER, v->value, sizeof(ast_config_AST_RUN_USER));
+			_SETVAR(ast_config_AST_RUN_USER, v->value);
 		/* What group to run as */
 		} else if (!strcasecmp(v->name, "rungroup")) {
-			ast_copy_string(ast_config_AST_RUN_GROUP, v->value, sizeof(ast_config_AST_RUN_GROUP));
+			_SETVAR(ast_config_AST_RUN_GROUP, v->value);
 		} else if (!strcasecmp(v->name, "systemname")) {
-			ast_copy_string(ast_config_AST_SYSTEM_NAME, v->value, sizeof(ast_config_AST_SYSTEM_NAME));
+			_SETVAR(ast_config_AST_SYSTEM_NAME, v->value);
 		} else if (!strcasecmp(v->name, "autosystemname")) {
 			if (ast_true(v->value)) {
 				if (!gethostname(hostname, sizeof(hostname) - 1))
-					ast_copy_string(ast_config_AST_SYSTEM_NAME, hostname, sizeof(ast_config_AST_SYSTEM_NAME));
+					_SETVAR(ast_config_AST_SYSTEM_NAME, hostname);
 				else {
 					if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)){
-						ast_copy_string(ast_config_AST_SYSTEM_NAME, "localhost", sizeof(ast_config_AST_SYSTEM_NAME));
+						_SETVAR(ast_config_AST_SYSTEM_NAME, "localhost");
 					}
 					ast_log(LOG_ERROR, "Cannot obtain hostname for this system.  Using '%s' instead.\n", ast_config_AST_SYSTEM_NAME);
 				}
@@ -2636,7 +2638,7 @@
 	int num;
 	int isroot = 1;
 	char *buf;
-	char *runuser = NULL, *rungroup = NULL;
+	const char *runuser = NULL, *rungroup = NULL;
 
 	/* Remember original args for restart */
 	if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
@@ -2732,7 +2734,7 @@
 			xarg = optarg;
 			break;
 		case 'C':
-			ast_copy_string(ast_config_AST_CONFIG_FILE, optarg, sizeof(ast_config_AST_CONFIG_FILE));
+			_SETVAR(ast_config_AST_CONFIG_FILE, optarg);
 			ast_set_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG);
 			break;
 		case 'I':

Modified: trunk/res/res_crypto.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_crypto.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/res/res_crypto.c (original)
+++ trunk/res/res_crypto.c Tue Dec 18 04:24:58 2007
@@ -146,7 +146,7 @@
  * \retval key on success.
  * \retval NULL on failure.
 */
-static struct ast_key *try_load_key(char *dir, char *fname, int ifd, int ofd, int *not2)
+static struct ast_key *try_load_key(const char *dir, const char *fname, int ifd, int ofd, int *not2)
 {
 	int ktype = 0, found = 0;
 	char *c = NULL, ffname[256];

Modified: trunk/res/res_monitor.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_monitor.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/res/res_monitor.c (original)
+++ trunk/res/res_monitor.c Tue Dec 18 04:24:58 2007
@@ -320,7 +320,7 @@
 			const char *format = !strcasecmp(chan->monitor->format,"wav49") ? "WAV" : chan->monitor->format;
 			char *name = chan->monitor->filename_base;
 			int directory = strchr(name, '/') ? 1 : 0;
-			char *dir = directory ? "" : ast_config_AST_MONITOR_DIR;
+			const char *dir = directory ? "" : ast_config_AST_MONITOR_DIR;
 			const char *execute, *execute_args;
 
 			/* Set the execute application */

Modified: trunk/utils/ael_main.c
URL: http://svn.digium.com/view/asterisk/trunk/utils/ael_main.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/utils/ael_main.c (original)
+++ trunk/utils/ael_main.c Tue Dec 18 04:24:58 2007
@@ -82,8 +82,8 @@
 
 int conts=0, extens=0, priors=0;
 char last_exten[18000];
-char ast_config_AST_CONFIG_DIR[PATH_MAX];
-char ast_config_AST_VAR_DIR[PATH_MAX];
+const char ast_config_AST_CONFIG_DIR[PATH_MAX];
+const char ast_config_AST_VAR_DIR[PATH_MAX];
 
 void ast_cli_register_multiple(void);
 int ast_add_extension2(struct ast_context *con,
@@ -514,14 +514,14 @@
 	}
 
 	if( use_curr_dir ) {
-		strcpy(ast_config_AST_CONFIG_DIR, ".");
+		strcpy((char *)ast_config_AST_CONFIG_DIR, ".");
 		localized_use_local_dir();
 	}
 	else {
-		strcpy(ast_config_AST_CONFIG_DIR, "/etc/asterisk");
+		strcpy((char *)ast_config_AST_CONFIG_DIR, "/etc/asterisk");
 		localized_use_conf_dir();
 	}
-	strcpy(ast_config_AST_VAR_DIR, "/var/lib/asterisk");
+	strcpy((char *)ast_config_AST_VAR_DIR, "/var/lib/asterisk");
 	
 	if( dump_extensions ) {
 		dumpfile = fopen("extensions.conf.aeldump","w");

Modified: trunk/utils/conf2ael.c
URL: http://svn.digium.com/view/asterisk/trunk/utils/conf2ael.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/utils/conf2ael.c (original)
+++ trunk/utils/conf2ael.c Tue Dec 18 04:24:58 2007
@@ -63,7 +63,7 @@
 int all_bits_set(unsigned int *word, int bitsperword, int totalbits);
 extern char *days[];
 extern char *months[];
-char ast_config_AST_CONFIG_DIR[PATH_MAX];
+const char ast_config_AST_CONFIG_DIR[PATH_MAX];
 
 char *config = "extensions.conf";
 
@@ -79,7 +79,7 @@
 /*! Go no deeper than this through includes (not counting loops) */
 #define AST_PBX_MAX_STACK	128
 /* static AST_RWLIST_HEAD_STATIC(acf_root, ast_custom_function); */
-extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
+//extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
 
 void ast_register_file_version(const char *file, const char *version)
 {
@@ -363,7 +363,7 @@
 	if (!localdir)
 		printf(" (You could use -d the use the extensions.conf in the current directory!)\n");
 
-	strcpy(ast_config_AST_CONFIG_DIR,"/etc/asterisk");
+	strcpy((char *)ast_config_AST_CONFIG_DIR,"/etc/asterisk");
 	
 	printf("Loading %s/%s...\n", ast_config_AST_CONFIG_DIR, config);
 

Modified: trunk/utils/extconf.c
URL: http://svn.digium.com/view/asterisk/trunk/utils/extconf.c?view=diff&rev=93603&r1=93602&r2=93603
==============================================================================
--- trunk/utils/extconf.c (original)
+++ trunk/utils/extconf.c Tue Dec 18 04:24:58 2007
@@ -53,7 +53,7 @@
 # include <glob.h>
 #endif
 
-static char ast_config_AST_CONFIG_DIR[PATH_MAX] = {"/etc/asterisk"};
+static const char ast_config_AST_CONFIG_DIR[PATH_MAX] = {"/etc/asterisk"};
 #define AST_API_MODULE  1 /* gimme the inline defs! */
 struct ast_channel 
 {


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits





More information about the asterisk-commits mailing list