[asterisk-commits] tilghman: branch 10 r377504 - in /branches/10: ./ addons/cdr_mysql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 9 19:24:44 CST 2012


Author: tilghman
Date: Sun Dec  9 19:24:41 2012
New Revision: 377504

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377504
Log:
Remove some dead code and additionally handle a case that wasn't handled.
........

Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/addons/cdr_mysql.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/addons/cdr_mysql.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/addons/cdr_mysql.c?view=diff&rev=377504&r1=377503&r2=377504
==============================================================================
--- branches/10/addons/cdr_mysql.c (original)
+++ branches/10/addons/cdr_mysql.c Sun Dec  9 19:24:41 2012
@@ -430,6 +430,9 @@
 	int res;
 	struct ast_config *cfg;
 	struct ast_variable *var;
+	/* CONFIG_STATUS_FILEUNCHANGED is impossible when config_flags is always 0,
+	 * and it has to be zero, so a reload can be sent to tell the driver to
+	 * rescan the table layout. */
 	struct ast_flags config_flags = { 0 };
 	struct column *entry;
 	char *temp;
@@ -445,11 +448,13 @@
 	 * have changed, which is not detectable by config file change detection,
 	 * but should still cause the configuration to be re-parsed. */
 	cfg = ast_config_load(config, config_flags);
-	if (!cfg) {
+	if (cfg == CONFIG_STATUS_FILEMISSING) {
 		ast_log(LOG_WARNING, "Unable to load config for mysql CDR's: %s\n", config);
 		return AST_MODULE_LOAD_SUCCESS;
-	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
-		return AST_MODULE_LOAD_SUCCESS;
+	} else if (cfg == CONFIG_STATUS_FILEINVALID) {
+		ast_log(LOG_ERROR, "Unable to load configuration file '%s'\n", config);
+		return AST_MODULE_LOAD_DECLINE;
+	}
 
 	if (reload) {
 		AST_RWLIST_WRLOCK(&columns);




More information about the asterisk-commits mailing list