From 012b3e6f2040d83c0336346be7483454fa3924e0 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 30 Dec 2000 21:05:45 +0000 Subject: Use macro API to Submitted by: "Peter Avalos" Reviewed by: /sbin/md5 --- sbin/fsck/fsck.c | 8 ++++---- sbin/fsck/preen.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 84fcdf1..2eb26a0 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -141,7 +141,7 @@ main(argc, argv) break; case 't': - if (selhead.tqh_first != NULL) + if (!TAILQ_EMPTY(&selhead)) errx(1, "only one -t option may be specified."); maketypelist(optarg); @@ -350,7 +350,7 @@ selected(type) struct entry *e; /* If no type specified, it's always selected. */ - for (e = selhead.tqh_first; e != NULL; e = e->entries.tqe_next) + TAILQ_FOREACH(e, &selhead, entries) if (!strncmp(e->type, type, MFSNAMELEN)) return which == IN_LIST ? 1 : 0; @@ -364,7 +364,7 @@ getoptions(type) { struct entry *e; - for (e = opthead.tqh_first; e != NULL; e = e->entries.tqe_next) + TAILQ_FOREACH(e, &opthead, entries) if (!strncmp(e->type, type, MFSNAMELEN)) return e->options; return ""; @@ -383,7 +383,7 @@ addoption(optstr) *newoptions++ = '\0'; - for (e = opthead.tqh_first; e != NULL; e = e->entries.tqe_next) + TAILQ_FOREACH(e, &opthead, entries) if (!strncmp(e->type, optstr, MFSNAMELEN)) { catopt(&e->options, newoptions); return; diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index e00e84e..3beda3e 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -230,7 +230,7 @@ checkfstab(flags, maxrun, docheck, checkit) } } if (sumstatus) { - p = badh.tqh_first; + p = TAILQ_FIRST(&badh); if (p == NULL) return (sumstatus); @@ -334,7 +334,7 @@ startdisk(d, checkit) int (*checkit) __P((const char *, const char *, const char *, void *, pid_t *)); { - struct partentry *p = d->d_part.tqh_first; + struct partentry *p = TAILQ_FIRST(&d->d_part); int rv; while ((rv = (*checkit)(p->p_type, p->p_devname, p->p_mntpt, -- cgit v1.1