git://scm.lunaixsky.com
/
lunaix-os.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9209afa
)
properly update the pprev of next node when deleting hlist_node (close #30)
author
Minep
<lunaixsky@qq.com>
Sat, 20 Apr 2024 10:19:15 +0000
(11:19 +0100)
committer
Minep
<lunaixsky@qq.com>
Sat, 20 Apr 2024 10:19:15 +0000
(11:19 +0100)
lunaix-os/includes/lunaix/ds/llist.h
patch
|
blob
|
history
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->next) {
+ node->next->pprev = node->pprev;
+ }
+
*node->pprev = node->next;
+
node->next = 0;
node->pprev = 0;
}