[svn-commits] twilson: branch twilson/config_work r364299 - in /team/twilson/config_work: a...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 27 14:39:10 CDT 2012


Author: twilson
Date: Fri Apr 27 14:39:05 2012
New Revision: 364299

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=364299
Log:
Address Mark's and Richard's non-documentation related review comments

Modified:
    team/twilson/config_work/apps/app_skel.c
    team/twilson/config_work/include/asterisk/config_options.h
    team/twilson/config_work/main/config_options.c

Modified: team/twilson/config_work/apps/app_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/apps/app_skel.c?view=diff&rev=364299&r1=364298&r2=364299
==============================================================================
--- team/twilson/config_work/apps/app_skel.c (original)
+++ team/twilson/config_work/apps/app_skel.c Fri Apr 27 14:39:05 2012
@@ -536,8 +536,10 @@
 	ast_mutex_unlock(&reload_lock);
 
 	ast_cli_register_multiple(skel_cli, ARRAY_LEN(skel_cli));
-	return ast_register_application_xml(app, app_exec) ?
-		AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
+	if (ast_register_application_xml(app, app_exec)) {
+		goto error;
+	}
+	return AST_MODULE_LOAD_SUCCESS;
 
 error:
 	aco_info_destroy(&cfg_info);

Modified: team/twilson/config_work/include/asterisk/config_options.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/include/asterisk/config_options.h?view=diff&rev=364299&r1=364298&r2=364299
==============================================================================
--- team/twilson/config_work/include/asterisk/config_options.h (original)
+++ team/twilson/config_work/include/asterisk/config_options.h Fri Apr 27 14:39:05 2012
@@ -186,7 +186,6 @@
  * \param obj An option object which holds type info about what is being configured
  * \param default_val The default value of the option in the same format as defined in a config file
  * \param opt_type The option type
- * \param struct_type The type of the struct being configured (e.g. struct skel_pvt_config)
  * \param flags \a type specific flags, stored in the option and available to the handler
  *
  * \returns An option on success, NULL on failure

Modified: team/twilson/config_work/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/main/config_options.c?view=diff&rev=364299&r1=364298&r2=364299
==============================================================================
--- team/twilson/config_work/main/config_options.c (original)
+++ team/twilson/config_work/main/config_options.c Fri Apr 27 14:39:05 2012
@@ -314,7 +314,7 @@
 static int process_category(struct ast_config *cfg, struct aco_info *info, const char *cat, int preload) {
 	RAII_VAR(void *, tmppvt, NULL, ao2_cleanup);
 	RAII_VAR(void *, tmpcfg, NULL, ao2_cleanup);
-	RAII_VAR(struct aco_type *, obj, internal_aco_type_find(info->objs, cfg, cat), ao2_cleanup);
+	RAII_VAR(struct aco_type *, obj, NULL, ao2_cleanup);
 
 	/* Skip preloaded categories if we aren't preloading */
 	if (!preload && is_preload(info, cat)) {
@@ -322,7 +322,7 @@
 	}
 
 	/* Find config object by context, if not found it is an error */
-	if (!obj) {
+	if (!(obj = internal_aco_type_find(info->objs, cfg, cat))) {
 		ast_log(LOG_ERROR, "Could not find config type for category '%s' in '%s'\n", cat, info->filename);
 		return -1;
 	}
@@ -421,7 +421,6 @@
 	ao2_callback(info->objs, OBJ_NODATA, allocate_temp_objects, &err);
 
 	if (err) {
-		ao2_callback(info->objs, OBJ_NODATA, cleanup_temp_objects, NULL);
 		ast_log(LOG_ERROR, "In %s: Could not allocate temporary objects\n", info->filename);
 		goto error;
 	}
@@ -461,7 +460,7 @@
 	for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
 		RAII_VAR(struct aco_option *, opt, aco_option_find(container, var->name, cat), ao2_cleanup);
 		if (!opt) {
-			ast_log(LOG_WARNING, "Could not find option suitable for category '%s' named '%s' at line %d\n", cat, var->name, var->lineno);
+			ast_log(LOG_WARNING, "Could not find option suitable for category '%s' named '%s' at line %d of %s\n", cat, var->name, var->lineno, var->file);
 			return -1;
 		}
 		if (!opt->handler) {
@@ -469,7 +468,7 @@
 			return -1;
 		}
 		if (opt->handler(opt, var, obj)) {
-			ast_log(LOG_WARNING, "Error parsing %s=%s at line %d\n", var->name, var->value, var->lineno);
+			ast_log(LOG_WARNING, "Error parsing %s=%s at line %d of %s\n", var->name, var->value, var->lineno, var->file);
 			return -1;
 		}
 	}




More information about the svn-commits mailing list