summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpluknet <pluknet@FreeBSD.org>2011-07-18 19:42:18 +0000
committerpluknet <pluknet@FreeBSD.org>2011-07-18 19:42:18 +0000
commita9ea37dda1816fb8e967e3825b2e7a71905e8cbc (patch)
tree5c8d714e6861817cc0279a9e5fd9173990e22fb3
parentb445693207351dbda5bbd548530025f2f358a0c6 (diff)
downloadFreeBSD-src-a9ea37dda1816fb8e967e3825b2e7a71905e8cbc.zip
FreeBSD-src-a9ea37dda1816fb8e967e3825b2e7a71905e8cbc.tar.gz
sintrcnt/sintrnames is the address of the size, not the actual size.
Use them appropriately to fetch the actual size. That fixes vmstat -i with kvm backend. Submitted by: peter Approved by: re (kib)
-rw-r--r--usr.bin/vmstat/vmstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 39e71fa..ba5df87 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1153,8 +1153,8 @@ dointr(void)
uptime = getuptime();
if (kd != NULL) {
- intrcntlen = namelist[X_SINTRCNT].n_value;
- inamlen = namelist[X_SINTRNAMES].n_value;
+ kread(X_SINTRCNT, &intrcntlen, sizeof(intrcntlen));
+ kread(X_SINTRNAMES, &inamlen, sizeof(inamlen));
if ((intrcnt = malloc(intrcntlen)) == NULL ||
(intrname = malloc(inamlen)) == NULL)
err(1, "malloc()");
OpenPOWER on IntegriCloud