git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28b9bd0
)
ldb: avoid tautological compare errors in DLIST_ADD_END
author
Michael Adam
<obnox@samba.org>
Tue, 12 Jul 2016 21:41:20 +0000
(23:41 +0200)
committer
Michael Adam
<obnox@samba.org>
Tue, 12 Jul 2016 21:43:06 +0000
(23:43 +0200)
lib/ldb/include/dlinklist.h
patch
|
blob
|
history
diff --git
a/lib/ldb/include/dlinklist.h
b/lib/ldb/include/dlinklist.h
index ef01aec9f1c5591a32deda00a6142dcb8f441709..ebaa3685d746aa06ef0548ad62cdc5b0125c88dd 100644
(file)
--- a/
lib/ldb/include/dlinklist.h
+++ b/
lib/ldb/include/dlinklist.h
@@
-136,8
+136,14
@@
do { \
do { \
if (!(list)) { \
DLIST_ADD(list, p); \
+ } else if (!((list)->prev)) { \
+ DLIST_ADD(list, p); \
} else { \
- DLIST_ADD_AFTER(list, p, (list)->prev); \
+ (p)->prev = (list)->prev; \
+ (p)->next = (list)->prev->next; \
+ (list)->prev->next = (p); \
+ if ((p)->next) (p)->next->prev = (p); \
+ (list)->prev = (p); \
} \
} while (0)