}
info->text = value;
info->lang = strdup(locale);
- *icon = g_list_append(*icon, info);
+ *icon = g_list_prepend(*icon, info);
return PMINFO_R_OK;
}
}
info->text = value;
info->lang = strdup(locale);
- *label = g_list_append(*label, info);
+ *label = g_list_prepend(*label, info);
return PMINFO_R_OK;
}
int __open_db(const char *path, sqlite3 **db, int flags)
{
int ret;
- int persist_wal = 1;
- int no_checkpoint = 1;
ret = sqlite3_open_v2(path, db, flags, NULL);
- if (ret != SQLITE_OK)
- return ret;
-
- ret = sqlite3_busy_handler(*db, __db_busy_handler, NULL);
if (ret != SQLITE_OK) {
- _LOGE("failed to register busy handler: %s",
- sqlite3_errmsg(*db));
sqlite3_close_v2(*db);
return ret;
}
- ret = sqlite3_file_control(*db, NULL,
- SQLITE_FCNTL_PERSIST_WAL, &persist_wal);
- if (ret != SQLITE_OK) {
- _LOGE("failed to sqlite3_file_control: %s",
- sqlite3_errmsg(*db));
- sqlite3_close_v2(*db);
- return ret;
- }
-
- ret = sqlite3_wal_autocheckpoint(*db, 0);
- if (ret != SQLITE_OK) {
- _LOGE("failed to sqlite3_wal_autocheckpoint: %s",
- sqlite3_errmsg(*db));
- sqlite3_close_v2(*db);
- return ret;
- }
-
- ret = sqlite3_db_config(*db, SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,
- &no_checkpoint);
+ ret = sqlite3_busy_handler(*db, __db_busy_handler, NULL);
if (ret != SQLITE_OK) {
- _LOGE("failed to execute sqlite3_db_config: %s",
+ _LOGE("failed to register busy handler: %s",
sqlite3_errmsg(*db));
sqlite3_close_v2(*db);
return ret;