summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkvm/kvm_file.c')
-rw-r--r--lib/libkvm/kvm_file.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libkvm/kvm_file.c b/lib/libkvm/kvm_file.c
index c8b9f4d..6786209 100644
--- a/lib/libkvm/kvm_file.c
+++ b/lib/libkvm/kvm_file.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93";
+static char sccsid[] = "@(#)kvm_file.c 8.2 (Berkeley) 8/20/94";
#endif /* LIBC_SCCS and not lint */
/*
@@ -80,7 +80,8 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
long filehead_o;
{
int buflen = kd->arglen, needed = buflen, error, n = 0;
- struct file *fp, file, *filehead;
+ struct file *fp, file;
+ struct filelist filehead;
register char *where = kd->argspc;
char *start = where;
@@ -94,12 +95,12 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
}
buflen -= sizeof (filehead);
where += sizeof (filehead);
- *(struct file **)kd->argspc = filehead;
+ *(struct filelist *)kd->argspc = filehead;
}
/*
* followed by an array of file structures
*/
- for (fp = filehead; fp != NULL; fp = fp->f_filef) {
+ for (fp = filehead.lh_first; fp != 0; fp = fp->f_list.le_next) {
if (buflen > sizeof (struct file)) {
if (KREAD(kd, (long)fp, ((struct file *)where))) {
_kvm_err(kd, kd->program, "can't read kfp");
@@ -125,7 +126,8 @@ kvm_getfiles(kd, op, arg, cnt)
int *cnt;
{
int mib[2], size, st, nfiles;
- struct file *filehead, *fp, *fplim;
+ struct file *fp, *fplim;
+ struct filelist filehead;
if (ISALIVE(kd)) {
size = 0;
@@ -148,11 +150,11 @@ kvm_getfiles(kd, op, arg, cnt)
_kvm_syserr(kd, kd->program, "kvm_getfiles");
return (0);
}
- filehead = *(struct file **)kd->argspc;
+ filehead = *(struct filelist *)kd->argspc;
fp = (struct file *)(kd->argspc + sizeof (filehead));
fplim = (struct file *)(kd->argspc + size);
- for (nfiles = 0; filehead && (fp < fplim); nfiles++, fp++)
- filehead = fp->f_filef;
+ for (nfiles = 0; filehead.lh_first && (fp < fplim); nfiles++, fp++)
+ filehead.lh_first = fp->f_list.le_next;
} else {
struct nlist nl[3], *p;
OpenPOWER on IntegriCloud