for (i = 1; ; i++) {
if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
- /* If the update succeeds, it returns 0. */
- if (eng->update_func && !(res = eng->update_func(db, table, keyfield, lookup, fields))) {
+ /* If the update succeeds, it returns >= 0. */
+ if (eng->update_func && ((res = eng->update_func(db, table, keyfield, lookup, fields)) >= 0)) {
break;
}
} else {
for (i = 1; ; i++) {
if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
- /* If the store succeeds, it returns 0. */
- if (eng->store_func && !(res = eng->store_func(db, table, fields))) {
+ /* If the store succeeds, it returns >= 0*/
+ if (eng->store_func && ((res = eng->store_func(db, table, fields)) >= 0)) {
break;
}
} else {
id->next = fields;
fields = id;
- return ast_store_realtime_fields(family, fields) ? -1 : 0;
+ return (ast_store_realtime_fields(family, fields) <= 0) ? -1 : 0;
}
/*! \brief Internal helper function which returns a filtered objectset.