Use macro API to <sys/queue.h>
Submitted by: "Jason" <jsmethers@pdq.net> Reviewed by: /sbin/md5
This commit is contained in:
parent
0d7b8d16dc
commit
2673ed4725
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70520
@ -134,7 +134,7 @@ int main()
|
||||
printf("%s:\n", if_indextoname(ifnet.if_index, ifname));
|
||||
|
||||
if6_addrlist(TAILQ_FIRST(&ifnet.if_addrhead));
|
||||
nifp = ifnet.if_link.tqe_next;
|
||||
nifp = TAILQ_NEXT(&ifnet, if_link);
|
||||
|
||||
/* not supported */
|
||||
|
||||
@ -191,7 +191,7 @@ if6_addrlist(ifap)
|
||||
KREAD(ifap, &if6a, struct in6_ifaddr);
|
||||
printf("\tinet6 %s\n", inet6_n2a(&if6a.ia_addr.sin6_addr));
|
||||
nextifap:
|
||||
ifap = ifa.ifa_link.tqe_next;
|
||||
ifap = TAILQ_NEXT(&ifa, ifa_link);
|
||||
}
|
||||
if (ifap0) {
|
||||
struct ifnet ifnet;
|
||||
@ -203,8 +203,8 @@ if6_addrlist(ifap)
|
||||
|
||||
KREAD(ifap0, &ifa, struct ifaddr);
|
||||
KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
|
||||
if (ifnet.if_multiaddrs.lh_first)
|
||||
ifmp = ifnet.if_multiaddrs.lh_first;
|
||||
if (LIST_FIRST(&ifnet.if_multiaddrs))
|
||||
ifmp = LIST_FIRST(&ifnet.if_multiaddrs);
|
||||
while (ifmp) {
|
||||
KREAD(ifmp, &ifm, struct ifmultiaddr);
|
||||
if (ifm.ifma_addr == NULL)
|
||||
@ -221,7 +221,7 @@ if6_addrlist(ifap)
|
||||
ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
|
||||
ifm.ifma_refcount);
|
||||
nextmulti:
|
||||
ifmp = ifm.ifma_link.le_next;
|
||||
ifmp = LIST_NEXT(&ifm, ifma_link);
|
||||
}
|
||||
}
|
||||
#ifdef N_IN6_MK
|
||||
@ -235,12 +235,12 @@ if6_addrlist(ifap)
|
||||
|
||||
nam = strdup(ifname(ifa.ifa_ifp));
|
||||
|
||||
for (mkp = in6_mk.lh_first; mkp; mkp = mk.mk_entry.le_next) {
|
||||
LIST_FOREACH(mkp, &in6_mk, mk_entry) {
|
||||
KREAD(mkp, &mk, struct multi6_kludge);
|
||||
if (strcmp(nam, ifname(mk.mk_ifp)) == 0 &&
|
||||
mk.mk_head.lh_first) {
|
||||
LIST_FIRST(&mk.mk_head)) {
|
||||
printf("\t(on kludge entry for %s)\n", nam);
|
||||
in6_multilist(mk.mk_head.lh_first);
|
||||
in6_multilist(LIST_FIRST(&mk.mk_head));
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ in6_multientry(mc)
|
||||
KREAD(mc, &multi, struct in6_multi);
|
||||
printf("\t\tgroup %s", inet6_n2a(&multi.in6m_addr));
|
||||
printf(" refcnt %u\n", multi.in6m_refcount);
|
||||
return(multi.in6m_entry.le_next);
|
||||
return(LIST_NEXT(&multi, in6m_entry));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -193,10 +193,10 @@ note_spool_dir(const struct printer *pp, const struct stat *st)
|
||||
err(++problems, "malloc(%lu)", strlen(pp->spool_dir) + 1UL);
|
||||
|
||||
last = 0;
|
||||
dp2 = dirlist.lh_first;
|
||||
while (dp2 && lessp(dp, dp2)) {
|
||||
LIST_FOREACH(dp2, &dirlist, link) {
|
||||
if(!lessp(dp, dp2))
|
||||
break;
|
||||
last = dp2;
|
||||
dp2 = dp2->link.le_next;
|
||||
}
|
||||
|
||||
if (last) {
|
||||
@ -211,8 +211,8 @@ check_spool_dirs(void)
|
||||
{
|
||||
struct dirlist *dp, *dp2;
|
||||
|
||||
for (dp = dirlist.lh_first; dp; dp = dp2) {
|
||||
dp2 = dp->link.le_next;
|
||||
for (dp = LIST_FIRST(&dirlist); dp; dp = dp2) {
|
||||
dp2 = LIST_NEXT(dp, link);
|
||||
|
||||
if (dp2 != 0 && equal(dp, dp2)) {
|
||||
++problems;
|
||||
|
@ -68,11 +68,11 @@ free_request(struct request *rp)
|
||||
free(rp->prettyname);
|
||||
if (rp->authinfo)
|
||||
free(rp->authinfo);
|
||||
while ((ru = rp->users.tqh_first) != 0) {
|
||||
while ((ru = TAILQ_FIRST(&rp->users)) != 0) {
|
||||
TAILQ_REMOVE(&rp->users, ru, ru_link);
|
||||
free(ru);
|
||||
}
|
||||
while ((rj = rp->jobids.tqh_first) != 0) {
|
||||
while ((rj = TAILQ_FIRST(&rp->jobids)) != 0) {
|
||||
TAILQ_REMOVE(&rp->jobids, rj, rj_link);
|
||||
free(rj);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user