提交 88ac83b4 authored 作者: Anthony Minessale's avatar Anthony Minessale

yay wasim found a bug i can actually fix right away for once

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7898 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 8033a479
......@@ -79,12 +79,13 @@ SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, s
{
int ret = 0;
int sane = 100;
char *err = NULL;
while(--sane > 0) {
ret = sqlite3_exec(db, sql, callback, data, errmsg);
ret = sqlite3_exec(db, sql, callback, data, &err);
if (ret == SQLITE_BUSY || ret == SQLITE_LOCKED) {
if (sane > 1) {
switch_safe_free(*errmsg);
switch_safe_free(err);
switch_yield(1000);
continue;
}
......@@ -93,6 +94,10 @@ SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, s
}
}
if (err && errmsg) {
*errmsg = err;
}
return ret;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论