diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-02-06 12:38:47 +1100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-02-10 15:38:16 -0800 |
commit | 54fc99e04b3475a9cc04274fa365edbd700d3491 (patch) | |
tree | c1f8b93c43b1af6215187e544d8fd888dee40901 /source3/lib/ldb/ldb_tdb | |
parent | ece7089918e37f407f84d13df9d816d5a6d90f2e (diff) | |
download | samba-54fc99e04b3475a9cc04274fa365edbd700d3491.tar.gz samba-54fc99e04b3475a9cc04274fa365edbd700d3491.tar.bz2 samba-54fc99e04b3475a9cc04274fa365edbd700d3491.zip |
s3-ldb: update the old ldb in s3 to use new DLIST macros
(cherry picked from commit a7d8bfd373392eecf4fff33d39b85e1b55ad901d)
Diffstat (limited to 'source3/lib/ldb/ldb_tdb')
-rw-r--r-- | source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c | 17 |
1 files changed, 2 insertions, 15 deletions
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; } |