diff options
author | phk <phk@FreeBSD.org> | 2001-01-29 09:45:51 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-01-29 09:45:51 +0000 |
commit | 77061a115db551088140aca8fbf1c9fc34628464 (patch) | |
tree | 93ce4ef74ab7c798d7b69dc54b7152f869b8f57b /sbin/dump/optr.c | |
parent | 2f446fa4553d73402dc952ae2f348a80942113e2 (diff) | |
download | FreeBSD-src-77061a115db551088140aca8fbf1c9fc34628464.zip FreeBSD-src-77061a115db551088140aca8fbf1c9fc34628464.tar.gz |
Use <sys/queue.h> instead of home-rolled list.
Submitted by: "Jason Smethers" <jsmethers@pdq.net>
Diffstat (limited to 'sbin/dump/optr.c')
-rw-r--r-- | sbin/dump/optr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 57067a2..47c5792 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -40,6 +40,7 @@ static const char rcsid[] = #endif /* not lint */ #include <sys/param.h> +#include <sys/queue.h> #include <sys/wait.h> #include <sys/time.h> @@ -401,11 +402,11 @@ allocfsent(fs) } struct pfstab { - struct pfstab *pf_next; + SLIST_ENTRY(pfstab) pf_list; struct fstab *pf_fstab; }; -static struct pfstab *table; +static SLIST_HEAD(, pfstab) table; void getfstab() @@ -427,8 +428,7 @@ getfstab() if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL) quit("%s\n", strerror(errno)); pf->pf_fstab = fs; - pf->pf_next = table; - table = pf; + SLIST_INSERT_HEAD(&table, pf, pf_list); } (void) endfsent(); } @@ -447,7 +447,7 @@ fstabsearch(key) register struct fstab *fs; char *rn; - for (pf = table; pf != NULL; pf = pf->pf_next) { + SLIST_FOREACH(pf, &table, pf_list) { fs = pf->pf_fstab; if (strcmp(fs->fs_file, key) == 0 || strcmp(fs->fs_spec, key) == 0) |