tdb2: tdb_parse_record() returns negative errors, not -1.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:10:32 +0000 (18:40 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:18:35 +0000 (11:18 +0200)
Fixup callers to tdb_parse_record() to be compatible with tdb2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/lib/dbwrap_tdb.c
source3/lib/gencache.c

index 0832b06a15b50ee6d480ee08098ea5f325d370ee..2b5f58a56d76852689d2f487507703d401ece34e 100644 (file)
@@ -183,7 +183,7 @@ static int db_tdb_parse(struct db_context *db, TDB_DATA key,
        struct db_tdb_ctx *ctx = talloc_get_type_abort(
                db->private_data, struct db_tdb_ctx);
 
-       return tdb_parse_record(ctx->wtdb->tdb, key, parser, private_data);
+       return tdb_parse_record(ctx->wtdb->tdb, key, parser, private_data) ? -1 : 0;
 }
 
 static NTSTATUS db_tdb_store(struct db_record *rec, TDB_DATA data, int flag)
index c00cc115af817333a21421f1f629e0afd40b8345..31ead7be7e3beed65941d3bb90d56e8cd047388f 100644 (file)
@@ -344,11 +344,11 @@ bool gencache_parse(const char *keystr,
        state.private_data = private_data;
 
        ret = tdb_parse_record(cache_notrans, key, gencache_parse_fn, &state);
-       if (ret != -1) {
+       if (ret == 0) {
                return true;
        }
        ret = tdb_parse_record(cache, key, gencache_parse_fn, &state);
-       return (ret != -1);
+       return (ret == 0);
 }
 
 struct gencache_get_data_blob_state {