summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-06 12:37:48 +1100
committerJeremy Allison <jra@samba.org>2010-02-10 15:36:20 -0800
commita5d2fb752cdb7e27a4949635b6486834d9fac313 (patch)
tree5db7ff0e74f0e63614068ea1cf1f7182c1bf39b9
parentf017edc59f06121db08dcbdfaa0b75b808560955 (diff)
downloadsamba-a5d2fb752cdb7e27a4949635b6486834d9fac313.tar.gz
samba-a5d2fb752cdb7e27a4949635b6486834d9fac313.tar.bz2
samba-a5d2fb752cdb7e27a4949635b6486834d9fac313.zip
s4-ldb: update ldb_tdb to use new DLIST_ macros
(cherry picked from commit 6ede911654566a7e21ded70dacac68df3b6a1bca)
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index 6ee8417e25..b9f3e79f20 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -22,6 +22,7 @@
*/
#include "ldb_tdb.h"
+#include "dlinklist.h"
/*
the purpose of this code is to work around the braindead posix locking
@@ -42,15 +43,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;
}
@@ -143,12 +136,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;
}