git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
properly update the pprev of next node when deleting hlist_node (close #30)
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
ds
/
llist.h
diff --git
a/lunaix-os/includes/lunaix/ds/llist.h
b/lunaix-os/includes/lunaix/ds/llist.h
index 1eec54bc42a16a36245a6278f2d32bcfd70a0ec3..88e25233e718eddc335ced9c326b3c9cfa742dbd 100644
(file)
--- a/
lunaix-os/includes/lunaix/ds/llist.h
+++ b/
lunaix-os/includes/lunaix/ds/llist.h
@@
-125,7
+125,13
@@
hlist_delete(struct hlist_node* node)
{
if (!node->pprev)
return;
{
if (!node->pprev)
return;
+
+ if (node->next) {
+ node->next->pprev = node->pprev;
+ }
+
*node->pprev = node->next;
*node->pprev = node->next;
+
node->next = 0;
node->pprev = 0;
}
node->next = 0;
node->pprev = 0;
}