1
0
Fork 0

Merging upstream version 4.3+20241108.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-14 06:11:53 +01:00
parent 1e24552bfc
commit 60ccb5b596
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
64 changed files with 2015 additions and 1768 deletions

15
dlink.c
View file

@ -26,6 +26,21 @@ void dl_free(void *v)
free(vv-1);
}
void dl_free_all(void *head)
{
/* The list head is linked with the list tail so in order to free
* all the elements properly there is a need to keep starting point.
*/
void *d = dl_next(head), *next;
while (d != head) {
next = dl_next(d);
dl_free(d);
d = next;
}
dl_free(head);
}
void dl_init(void *v)
{
dl_next(v) = v;