diff options
Diffstat (limited to 'lib/tdb/common')
-rw-r--r-- | lib/tdb/common/tdb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c index 7317a3aa52..953c811c70 100644 --- a/lib/tdb/common/tdb.c +++ b/lib/tdb/common/tdb.c @@ -222,6 +222,8 @@ TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key) * * This is interesting for all readers of potentially large data structures in * the tdb records, ldb indexes being one example. + * + * Return -1 if the record was not found. */ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key, @@ -238,9 +240,10 @@ int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key, hash = tdb->hash_fn(&key); if (!(rec_ptr = tdb_find_lock_hash(tdb,key,hash,F_RDLCK,&rec))) { + /* record not found */ tdb_trace_1rec_ret(tdb, "tdb_parse_record", key, -1); tdb->ecode = TDB_ERR_NOEXIST; - return 0; + return -1; } tdb_trace_1rec_ret(tdb, "tdb_parse_record", key, 0); |