if (ret != PRIVILEGE_DB_MANAGER_ERR_NONE)
return ret;
- sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, NULL, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for BEGIN IMMEDIATE TRANSACTION failed");
GList *l = NULL;
for (l = privilege_list; l != NULL; l = l->next) {
char *privilege_name = (char *)l->data;
sqlite3_free(sql);
}
- sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for COMMIT TRANSACTION failed");
__finalize_db(db, stmt, NULL);
return PRIVILEGE_DB_MANAGER_ERR_NONE;
}
if (ret != PRIVILEGE_DB_MANAGER_ERR_NONE)
return ret;
- sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, NULL, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for BEGIN IMMEDIATE TRANSACTION failed");
GList *l = NULL;
for (l = privilege_list; l != NULL; l = l->next) {
char *privilege_name = (char *)l->data;
sqlite3_free(sql);
}
- sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for COMMIT TRANSACTION failed");
__finalize_db(db, stmt, NULL);
return PRIVILEGE_DB_MANAGER_ERR_NONE;
}
ret = privilege_db_manager_get_mapped_privilege_list(api_version, package_type, critical_privilege_list, &mapped_privilege_list);
TryReturn(ret == PRIVILEGE_DB_MANAGER_ERR_NONE && mapped_privilege_list != NULL, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] privilege_db_manager_get_mapped_privilege_list failed");
- sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, NULL, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for BEGIN IMMEDIATE TRANSACTION failed");
GList *l = NULL;
for (l = mapped_privilege_list; l != NULL; l = l->next) {
char *privilege_name = (char *)l->data;
}
g_list_free_full(mapped_privilege_list, free);
- sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for COMMIT TRANSACTION failed");
__finalize_db(db, stmt, NULL);
return PRIVILEGE_DB_MANAGER_ERR_NONE;
}
ret = privilege_db_manager_get_mapped_privilege_list(api_version, package_type, privilege_list, &mapped_privilege_list);
TryReturn(ret == PRIVILEGE_DB_MANAGER_ERR_NONE && mapped_privilege_list != NULL, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] privilege_db_manager_get_mapped_privilege_list failed");
- sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, NULL, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for BEGIN IMMEDIATE TRANSACTION failed");
GList *l = NULL;
for (l = mapped_privilege_list; l != NULL; l = l->next) {
char *privilege_name = (char *)l->data;
}
g_list_free_full(mapped_privilege_list, free);
- sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+ TryReturn(sqlite3_exec(db, "COMMIT TRANSACTION", NULL, NULL, NULL) == SQLITE_OK, __finalize_db(db, stmt, NULL), PRIVILEGE_DB_MANAGER_ERR_DB_UPDATE_FAIL, "[DB_FAIL] sqlite3_exec for COMMIT TRANSACTION failed");
__finalize_db(db, stmt, NULL);
return PRIVILEGE_DB_MANAGER_ERR_NONE;
}