diff options
author | phk <phk@FreeBSD.org> | 2000-12-30 20:56:04 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-12-30 20:56:04 +0000 |
commit | 8211e35e910df6acf5a46354fb40e441cd2bf9e0 (patch) | |
tree | b317a17df50a2372fc00247eb734771303f7e3f8 | |
parent | f13a78af6460bf80a600eab448339dac0da2db88 (diff) | |
download | FreeBSD-src-8211e35e910df6acf5a46354fb40e441cd2bf9e0.zip FreeBSD-src-8211e35e910df6acf5a46354fb40e441cd2bf9e0.tar.gz |
Use macro API to <sys/queue.h>
Submitted by: "Jason" <jsmethers@pdq.net>
Reviewed by: /sbin/md5
-rw-r--r-- | usr.sbin/ifmcstat/ifmcstat.c | 18 | ||||
-rw-r--r-- | usr.sbin/lpr/chkprintcap/chkprintcap.c | 10 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/request.c | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 862601a..79ef2e0 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -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 diff --git a/usr.sbin/lpr/chkprintcap/chkprintcap.c b/usr.sbin/lpr/chkprintcap/chkprintcap.c index 8b84656..405a112 100644 --- a/usr.sbin/lpr/chkprintcap/chkprintcap.c +++ b/usr.sbin/lpr/chkprintcap/chkprintcap.c @@ -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; diff --git a/usr.sbin/lpr/common_source/request.c b/usr.sbin/lpr/common_source/request.c index e3e4366..79ea90b 100644 --- a/usr.sbin/lpr/common_source/request.c +++ b/usr.sbin/lpr/common_source/request.c @@ -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); } |