Use macro API to <sys/queue.h>

This commit is contained in:
ben 2000-12-30 21:52:34 +00:00
parent 4ea1588b37
commit cc8f3da609
2 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
/*
* followed by an array of file structures
*/
for (fp = filehead.lh_first; fp != 0; fp = fp->f_list.le_next) {
LIST_FOREACH(fp, &filehead, f_list) {
if (buflen > sizeof (struct file)) {
if (KREAD(kd, (long)fp, ((struct file *)where))) {
_kvm_err(kd, kd->program, "can't read kfp");
@ -156,8 +156,8 @@ kvm_getfiles(kd, op, arg, cnt)
filehead = *(struct filelist *)kd->argspc;
fp = (struct file *)(kd->argspc + sizeof (filehead));
fplim = (struct file *)(kd->argspc + size);
for (nfiles = 0; filehead.lh_first && (fp < fplim); nfiles++, fp++)
filehead.lh_first = fp->f_list.le_next;
for (nfiles = 0; LIST_FIRST(&filehead) && (fp < fplim); nfiles++, fp++)
LIST_FIRST(&filehead) = LIST_NEXT(fp, f_list);
} else {
struct nlist nl[3], *p;

View File

@ -123,7 +123,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
kp = &kinfo_proc;
kp->ki_structsize = sizeof(kinfo_proc);
for (; cnt < maxcnt && p != NULL; p = proc.p_list.le_next) {
for (; cnt < maxcnt && p != NULL; p = LIST_NEXT(&proc, p_list)) {
if (KREAD(kd, (u_long)p, &proc)) {
_kvm_err(kd, kd->program, "can't read proc at %x", p);
return (-1);