Use older functions out of deference to older distros
authorTerry Wilson <twilson@digium.com>
Thu, 7 Jul 2011 16:50:54 +0000 (16:50 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 7 Jul 2011 16:50:54 +0000 (16:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326750 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/db.c
utils/astdb2sqlite3.c

index a1fff21..6a48b33 100644 (file)
--- a/main/db.c
+++ b/main/db.c
@@ -127,7 +127,7 @@ DEFINE_SQL_STATEMENT(create_astdb_stmt, "CREATE TABLE IF NOT EXISTS astdb(key VA
 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 @@ static int db_open(void)
        }
 
        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);
index 2541417..b0751dc 100644 (file)
@@ -134,7 +134,7 @@ static int convert_bdb_to_sqlite3(const char *bdb_dbname)
 
 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 init_statements(void)
 
 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;