aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w/w.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/w/w.c')
-rw-r--r--usr.bin/w/w.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index d91aa8cb8a9b..0ead030b84de 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -114,7 +114,7 @@ struct entry {
struct kinfo_proc *dkp; /* debug option proc list */
} *ep, *ehead = NULL, **nextp = &ehead;
-#define debugproc(p) *((struct kinfo_proc **)&(p)->kp_eproc.e_spare[0])
+#define debugproc(p) *((struct kinfo_proc **)&(p)->ki_spare[0])
static void pr_header __P((time_t *, int));
static struct stat *ttystat __P((char *, int));
@@ -273,27 +273,23 @@ main(argc, argv)
if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
err(1, "%s", kvm_geterr(kd));
for (i = 0; i < nentries; i++, kp++) {
- struct proc *pr = &kp->kp_proc;
- struct eproc *e;
-
- if (pr->p_stat == SIDL || pr->p_stat == SZOMB)
+ if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB)
continue;
- e = &kp->kp_eproc;
for (ep = ehead; ep != NULL; ep = ep->next) {
- if (ep->tdev == e->e_tdev) {
+ if (ep->tdev == kp->ki_tdev) {
/*
* proc is associated with this terminal
*/
- if (ep->kp == NULL && e->e_pgid == e->e_tpgid) {
+ if (ep->kp == NULL && kp->ki_pgid == kp->ki_tpgid) {
/*
* Proc is 'most interesting'
*/
- if (proc_compare(&ep->kp->kp_proc, pr))
+ if (proc_compare(ep->kp, kp))
ep->kp = kp;
}
/*
* Proc debug option info; add to debug
- * list using kinfo_proc kp_eproc.e_spare
+ * list using kinfo_proc ki_spare[0]
* as next pointer; ptr to ptr avoids the
* ptr = long assumption.
*/
@@ -318,7 +314,7 @@ main(argc, argv)
continue;
}
ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
- ep->kp->kp_proc.p_comm, MAXCOMLEN);
+ ep->kp->ki_comm, MAXCOMLEN);
if (ep->args == NULL)
err(1, NULL);
}
@@ -389,11 +385,11 @@ main(argc, argv)
char *ptr;
ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth),
- dkp->kp_proc.p_comm, MAXCOMLEN);
+ dkp->ki_comm, MAXCOMLEN);
if (ptr == NULL)
ptr = "-";
(void)printf("\t\t%-9d %s\n",
- dkp->kp_proc.p_pid, ptr);
+ dkp->ki_pid, ptr);
}
}
(void)printf("%-*.*s %-*.*s %-*.*s ",