5 struct list_node *list_check_node(const struct list_node *node,
8 const struct list_node *p, *n;
11 for (p = node, n = node->next; n != node; p = n, n = n->next) {
17 "%s: prev corrupt in node %p (%u) of %p\n",
18 abortstr, n, count, node);
22 return (struct list_node *)node;
25 struct list_head *list_check(const struct list_head *h, const char *abortstr)
27 if (h->n.next == &h->n) {
28 if (h->n.prev != &h->n) {
31 fprintf(stderr, "%s: prev corrupt in empty %p\n",
35 return (struct list_head *)h;
38 if (!list_check_node(&h->n, abortstr))
40 return (struct list_head *)h;