svn commit: r243097 - stable/9/usr.bin/ktrdump

Navdeep Parhar np at FreeBSD.org
Thu Nov 15 19:27:12 UTC 2012


Author: np
Date: Thu Nov 15 19:27:11 2012
New Revision: 243097
URL: http://svnweb.freebsd.org/changeset/base/243097

Log:
  MFC r242378:
  Catch up with r238925.  ktr_entries may not be a power of 2.

Modified:
  stable/9/usr.bin/ktrdump/ktrdump.c
Directory Properties:
  stable/9/usr.bin/ktrdump/   (props changed)

Modified: stable/9/usr.bin/ktrdump/ktrdump.c
==============================================================================
--- stable/9/usr.bin/ktrdump/ktrdump.c	Thu Nov 15 19:23:39 2012	(r243096)
+++ stable/9/usr.bin/ktrdump/ktrdump.c	Thu Nov 15 19:27:11 2012	(r243097)
@@ -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;


More information about the svn-src-stable-9 mailing list