Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jul 2011 19:42:18 +0000 (UTC)
From:      Sergey Kandaurov <pluknet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r224198 - head/usr.bin/vmstat
Message-ID:  <201107181942.p6IJgIqe036673@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pluknet
Date: Mon Jul 18 19:42:18 2011
New Revision: 224198
URL: http://svn.freebsd.org/changeset/base/224198

Log:
  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)

Modified:
  head/usr.bin/vmstat/vmstat.c

Modified: head/usr.bin/vmstat/vmstat.c
==============================================================================
--- head/usr.bin/vmstat/vmstat.c	Mon Jul 18 19:26:16 2011	(r224197)
+++ head/usr.bin/vmstat/vmstat.c	Mon Jul 18 19:42:18 2011	(r224198)
@@ -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()");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107181942.p6IJgIqe036673>