From 54fc99e04b3475a9cc04274fa365edbd700d3491 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 Feb 2010 12:38:47 +1100 Subject: s3-ldb: update the old ldb in s3 to use new DLIST macros (cherry picked from commit a7d8bfd373392eecf4fff33d39b85e1b55ad901d) --- source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'source3/lib/ldb/ldb_tdb') diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c index 2fff74d59a..64463f7c91 100644 --- a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c +++ b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c @@ -45,15 +45,7 @@ static struct ltdb_wrap *tdb_list; static int ltdb_wrap_destructor(struct ltdb_wrap *w) { tdb_close(w->tdb); - if (w->next) { - w->next->prev = w->prev; - } - if (w->prev) { - w->prev->next = w->next; - } - if (w == tdb_list) { - tdb_list = w->next; - } + DLIST_REMOVE(tdb_list, w); return 0; } @@ -142,12 +134,7 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx, talloc_set_destructor(w, ltdb_wrap_destructor); - w->next = tdb_list; - w->prev = NULL; - if (tdb_list) { - tdb_list->prev = w; - } - tdb_list = w; + DLIST_ADD(tdb_list, w); return w->tdb; } -- cgit