From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 21:10:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 723B32A0; Tue, 30 Oct 2012 21:10:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0498FC0A; Tue, 30 Oct 2012 21:10:07 +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 q9ULA7Oh076563; Tue, 30 Oct 2012 21:10:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ULA7AS076560; Tue, 30 Oct 2012 21:10:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210302110.q9ULA7AS076560@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Oct 2012 21:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242378 - head/usr.bin/ktrdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 30 Oct 2012 21:10:07 -0000 Author: np Date: Tue Oct 30 21:10:06 2012 New Revision: 242378 URL: http://svn.freebsd.org/changeset/base/242378 Log: Catch up with r238925. ktr_entries may not be a power of 2. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Tue Oct 30 21:05:06 2012 (r242377) +++ head/usr.bin/ktrdump/ktrdump.c Tue Oct 30 21:10:06 2012 (r242378) @@ -218,7 +218,7 @@ main(int ac, char **av) * Now tear through the trace buffer. */ if (!iflag) - i = (index - 1) & (entries - 1); + i = (index - 1) % entries; tlast = -1; for (;;) { if (buf[i].ktr_desc == NULL) @@ -286,7 +286,7 @@ next: if ((c = *p++) == '\0') if (!iflag) { if (i == index) break; - i = (i - 1) & (entries - 1); + i = (i - 1) % entries; } else { if (++i == entries) break;