git: 9ef73e4878d0 - main - tdestroy(3): Take posix_tnode * like the other tsearch(3) functions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Nov 2026 22:26:01 UTC
The branch main has been updated by obiwac:
URL: https://cgit.FreeBSD.org/src/commit/?id=9ef73e4878d01542e89273426fd036f54285653e
commit 9ef73e4878d01542e89273426fd036f54285653e
Author: Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2026-11-23 14:40:54 +0000
Commit: Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-11-23 22:25:44 +0000
tdestroy(3): Take posix_tnode * like the other tsearch(3) functions
tdestroy(3) was originally a glibc extension. glibc does not use
posix_tnode (yet), and when tdestroy(3) was pulled in its signature was
not updated to match the other tsearch(3) functions.
Fixes: b8c99e7d912f ("libc: add glibc-compatible tdestroy(3)")
Sponsored by: Klara, Inc.
---
include/search.h | 2 +-
lib/libc/stdlib/tdestroy.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/search.h b/include/search.h
index 5ac25a0d491f..b18637b33e8c 100644
--- a/include/search.h
+++ b/include/search.h
@@ -77,7 +77,7 @@ void twalk(const posix_tnode *, void (*)(const posix_tnode *, VISIT, int));
int hcreate_r(size_t, struct hsearch_data *);
void hdestroy_r(struct hsearch_data *);
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
-void tdestroy(void *, void (*)(void *));
+void tdestroy(posix_tnode *, void (*)(void *));
#endif
__END_DECLS
diff --git a/lib/libc/stdlib/tdestroy.c b/lib/libc/stdlib/tdestroy.c
index 2aeb02228e46..cd4bf4fce001 100644
--- a/lib/libc/stdlib/tdestroy.c
+++ b/lib/libc/stdlib/tdestroy.c
@@ -17,7 +17,7 @@ nul_node_free(void *node __unused)
}
void
-tdestroy(void *rootp, void (*node_free)(void *))
+tdestroy(posix_tnode *rootp, void (*node_free)(void *))
{
posix_tnode *back, *curr, **front;