From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 19:42:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60A8106566C; Mon, 18 Jul 2011 19:42:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95BEC8FC14; Mon, 18 Jul 2011 19:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IJgIha036675; Mon, 18 Jul 2011 19:42:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IJgIqe036673; Mon, 18 Jul 2011 19:42:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201107181942.p6IJgIqe036673@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 18 Jul 2011 19:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224198 - head/usr.bin/vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 19:42:18 -0000 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()");