From c5d03cbff806c564d4903277bd2b866ba8bf9c7e Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Tue, 5 Jul 2011 13:43:59 +0200 Subject: s3:dbwrap: implement dbwrap_fallback_exists() with dbwrap_parse_record() Signed-off-by: Michael Adam --- source3/lib/dbwrap/dbwrap.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'source3') diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 92f82e6779..af8e28cb7e 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -49,16 +49,8 @@ int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, static int dbwrap_fallback_exists(struct db_context *db, TDB_DATA key) { - TDB_DATA val; - if ( db->fetch(db, talloc_tos(), key, &val) != 0 ) { - return 0; - } - if (val.dptr == NULL ) { - return 0; - } else { - TALLOC_FREE(val.dptr); - return 1; - } + int res = dbwrap_parse_record(db, key, NULL, NULL); + return ( res == -1) ? 0 : 1; } /* -- cgit