summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-10-11 21:56:27 +0000
committerpeter <peter@FreeBSD.org>2004-10-11 21:56:27 +0000
commit9213c0d6bf4181ed08a1cf6f9721baf1e826b019 (patch)
tree310131ecb94db8d34523d4e82eab40b68ee1d0c4 /lib/libkvm
parent46a2ab741b6075ccd621c6f18ab775221c1b28cd (diff)
downloadFreeBSD-src-9213c0d6bf4181ed08a1cf6f9721baf1e826b019.zip
FreeBSD-src-9213c0d6bf4181ed08a1cf6f9721baf1e826b019.tar.gz
Belatedly catch up with the dev_t/cdev changes from a few months back.
Extract the struct cdev pointer and the tty device from inside rather than incorrectly casting the 'struct cdev *' pointer to a 'dev_t' int. Not that this was particularly important since it was only used for reading vmcore files.
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm_proc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 2e76d93..c439bf5 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/file.h>
+#include <sys/conf.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -98,6 +99,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
struct kinfo_proc kinfo_proc, *kp;
struct pgrp pgrp;
struct session sess;
+ struct cdev t_cdev;
struct tty tty;
struct vmspace vmspace;
struct sigacts sigacts;
@@ -272,7 +274,15 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
"can't read tty at %x", sess.s_ttyp);
return (-1);
}
- kp->ki_tdev = tty.t_dev; /* XXX: wrong */
+ if (tty.t_dev != NULL) {
+ if (KREAD(kd, (u_long)tty.t_dev, &t_cdev)) {
+ _kvm_err(kd, kd->program,
+ "can't read cdev at %x",
+ tty.t_dev);
+ return (-1);
+ }
+ kp->ki_tdev = t_cdev.si_udev;
+ }
if (tty.t_pgrp != NULL) {
if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) {
_kvm_err(kd, kd->program,
OpenPOWER on IntegriCloud