diff options
author | Toomas Soome <tsoome@me.com> | 2017-08-10 19:15:07 +0300 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2017-11-29 00:05:19 +0000 |
commit | 61d32c33314163cd44fd93c77f2606de94baee81 (patch) | |
tree | f268eb3a84db37b75e8ccc8094c52946a36384d8 /usr/src | |
parent | c5bab7026b8e0ac44b25ee08507ea360f177d844 (diff) | |
download | illumos-gate-61d32c33314163cd44fd93c77f2606de94baee81.tar.gz |
8762 syslogd: variable 'prev' set but not used
Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net>
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/syslogd/list.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/cmd/syslogd/list.c b/usr/src/cmd/syslogd/list.c index 06368d3d17..eb239c4f1f 100644 --- a/usr/src/cmd/syslogd/list.c +++ b/usr/src/cmd/syslogd/list.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <pthread.h> #include <malloc.h> #include <memory.h> @@ -32,12 +30,14 @@ #include <poll.h> #include <stdio.h> #include "llt.h" + void ll_init(llh_t *head) { head->back = &head->front; head->front = NULL; } + void ll_enqueue(llh_t *head, ll_t *data) { @@ -45,6 +45,7 @@ ll_enqueue(llh_t *head, ll_t *data) *head->back = data; head->back = &data->n; } + /* * apply the function func to every element of the ll in sequence. Can * be used to free up the element, so "n" is computed before func is @@ -62,11 +63,13 @@ ll_mapf(llh_t *head, void (*func)(void *)) t = n; } } + ll_t * ll_peek(llh_t *head) { return (head->front); } + ll_t * ll_dequeue(llh_t *head) { @@ -76,6 +79,7 @@ ll_dequeue(llh_t *head) head->back = &head->front; return (ptr); } + ll_t * ll_traverse(llh_t *ptr, int (*func)(void *, void *), void *user) { @@ -99,17 +103,22 @@ ll_traverse(llh_t *ptr, int (*func)(void *, void *), void *user) } return (NULL); } + /* Make sure the list isn't corrupt and returns number of list items */ int ll_check(llh_t *head) { int i = 0; ll_t *ptr = head->front; +#ifndef NDEBUG ll_t **prev = &head->front; +#endif while (ptr) { i++; +#ifndef NDEBUG prev = &ptr->n; +#endif ptr = ptr->n; } assert(head->back == prev); |