[asterisk-commits] twilson: trunk r326750 - in /trunk: main/db.c utils/astdb2sqlite3.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 7 11:50:58 CDT 2011


Author: twilson
Date: Thu Jul  7 11:50:54 2011
New Revision: 326750

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=326750
Log:
Use older functions out of deference to older distros

Modified:
    trunk/main/db.c
    trunk/utils/astdb2sqlite3.c

Modified: trunk/main/db.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/db.c?view=diff&rev=326750&r1=326749&r2=326750
==============================================================================
--- trunk/main/db.c (original)
+++ trunk/main/db.c Thu Jul  7 11:50:54 2011
@@ -127,7 +127,7 @@
 static int init_stmt(sqlite3_stmt **stmt, const char *sql, size_t len)
 {
 	ast_mutex_lock(&dblock);
-	if (sqlite3_prepare_v2(astdb, sql, len, stmt, NULL) != SQLITE_OK) {
+	if (sqlite3_prepare(astdb, sql, len, stmt, NULL) != SQLITE_OK) {
 		ast_log(LOG_WARNING, "Couldn't prepare statement '%s': %s\n", sql, sqlite3_errmsg(astdb));
 		ast_mutex_unlock(&dblock);
 		return -1;
@@ -211,7 +211,7 @@
 	}
 
 	ast_mutex_lock(&dblock);
-	if (sqlite3_open_v2(dbname, &astdb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
+	if (sqlite3_open(dbname, &astdb) != SQLITE_OK) {
 		ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", dbname, sqlite3_errmsg(astdb));
 		sqlite3_close(astdb);
 		ast_mutex_unlock(&dblock);

Modified: trunk/utils/astdb2sqlite3.c
URL: http://svnview.digium.com/svn/asterisk/trunk/utils/astdb2sqlite3.c?view=diff&rev=326750&r1=326749&r2=326750
==============================================================================
--- trunk/utils/astdb2sqlite3.c (original)
+++ trunk/utils/astdb2sqlite3.c Thu Jul  7 11:50:54 2011
@@ -134,7 +134,7 @@
 
 static int init_stmt(sqlite3_stmt **stmt, const char *sql, size_t len)
 {
-	if (sqlite3_prepare_v2(astdb, sql, len, stmt, NULL) != SQLITE_OK) {
+	if (sqlite3_prepare(astdb, sql, len, stmt, NULL) != SQLITE_OK) {
 		fprintf(stderr, "Couldn't prepare statement '%s': %s\n", sql, sqlite3_errmsg(astdb));
 		return -1;
 	}
@@ -171,7 +171,7 @@
 
 static int db_open(const char *dbname)
 {
-	if (sqlite3_open_v2(dbname, &astdb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
+	if (sqlite3_open(dbname, &astdb) != SQLITE_OK) {
 		fprintf(stderr, "Unable to open Asterisk database '%s': %s\n", dbname, sqlite3_errmsg(astdb));
 		sqlite3_close(astdb);
 		return -1;




More information about the asterisk-commits mailing list