Licensing Information

Open Source Used In Cisco FXOS 1.1(4) 972
return 0;
}
/* a miss - drat */
free(data);
data = NULL;
}
/* move to the next record */
last_ptr = rec_ptr;
lastrec = rec;
rec_ptr = rec.next;
}
fail:
if (data) free(data);
tdb_unlock(tdb, BUCKET(hash));
return -1;
fail2:
if (data) free(data);
tdb_unlock(tdb, -1);
return -1;
}
/* store an element in the database, replacing any existing element
with the same key
return 0 on success, -1 on failure
*/
int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
{
struct list_struct rec;
unsigned hash;
tdb_off rec_ptr, offset;
char *p = NULL;
info("Enter: tdb_store.");
if (tdb == NULL) {
#ifdef TDB_DEBUG
printf("tdb_store() called with null context\n");
#endif
return -1;
}
/* find which hash bucket it is in */
hash = tdb_hash(&key);