mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Use older functions out of deference to older distros
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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)
|
static int init_stmt(sqlite3_stmt **stmt, const char *sql, size_t len)
|
||||||
{
|
{
|
||||||
ast_mutex_lock(&dblock);
|
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_log(LOG_WARNING, "Couldn't prepare statement '%s': %s\n", sql, sqlite3_errmsg(astdb));
|
||||||
ast_mutex_unlock(&dblock);
|
ast_mutex_unlock(&dblock);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -211,7 +211,7 @@ static int db_open(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ast_mutex_lock(&dblock);
|
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));
|
ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", dbname, sqlite3_errmsg(astdb));
|
||||||
sqlite3_close(astdb);
|
sqlite3_close(astdb);
|
||||||
ast_mutex_unlock(&dblock);
|
ast_mutex_unlock(&dblock);
|
||||||
|
@@ -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)
|
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));
|
fprintf(stderr, "Couldn't prepare statement '%s': %s\n", sql, sqlite3_errmsg(astdb));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ static int init_statements(void)
|
|||||||
|
|
||||||
static int db_open(const char *dbname)
|
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));
|
fprintf(stderr, "Unable to open Asterisk database '%s': %s\n", dbname, sqlite3_errmsg(astdb));
|
||||||
sqlite3_close(astdb);
|
sqlite3_close(astdb);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user