[asterisk-commits] seanbright: branch seanbright/cdr-tds-conversion r124599 - /team/seanbright/c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jun 22 09:58:09 CDT 2008


Author: seanbright
Date: Sun Jun 22 09:58:08 2008
New Revision: 124599

URL: http://svn.digium.com/view/asterisk?view=rev&rev=124599
Log:
Pay attention to the return value of mssql_connect.

Modified:
    team/seanbright/cdr-tds-conversion/cdr/cdr_tds.c

Modified: team/seanbright/cdr-tds-conversion/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/cdr-tds-conversion/cdr/cdr_tds.c?view=diff&rev=124599&r1=124598&r2=124599
==============================================================================
--- team/seanbright/cdr-tds-conversion/cdr/cdr_tds.c (original)
+++ team/seanbright/cdr-tds-conversion/cdr/cdr_tds.c Sun Jun 22 09:58:08 2008
@@ -215,8 +215,7 @@
 	}
 
 	/* Consume any results we might get back (this is more of a sanity check than
-	 * anything else, since an INSERT shouldn't return results).
-	 */
+	 * anything else, since an INSERT shouldn't return results). */
 	while ((erc = dbresults(settings->dbproc)) != NO_MORE_RESULTS) {
 		while (dbnextrow(settings->dbproc) != NO_MORE_ROWS);
 	}
@@ -467,7 +466,12 @@
 	ast_config_destroy(cfg);
 
 	mssql_disconnect();
-	mssql_connect();
+
+	if (mssql_connect()) {
+		/* We failed to connect (mssql_connect) takes care of logging it. */
+		ast_mutex_unlock(&settings->lock);
+		return 0;
+	}
 
 	ast_mutex_unlock(&settings->lock);
 




More information about the asterisk-commits mailing list