svn commit: r244196 - projects/calloutng/sys/kern

Alexander Motin mav at FreeBSD.org
Thu Dec 13 23:05:46 UTC 2012


Author: mav
Date: Thu Dec 13 23:05:45 2012
New Revision: 244196
URL: http://svnweb.freebsd.org/changeset/base/244196

Log:
  Use correct precision for legacy callouts. Zero flags mean precision of
  half tick, not a full interval.

Modified:
  projects/calloutng/sys/kern/kern_timeout.c

Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c	Thu Dec 13 23:03:37 2012	(r244195)
+++ projects/calloutng/sys/kern/kern_timeout.c	Thu Dec 13 23:05:45 2012	(r244196)
@@ -938,11 +938,15 @@ _callout_reset_on(struct callout *c, str
 		if (to_ticks > 1)
 			bintime_mul(&to_bt, to_ticks);
 		bintime_add(&to_bt, &now);
-		to_ticks >>= C_PRELGET(flags);
-		if (to_ticks == 0)
+		if (C_PRELGET(flags) == 0) {
 			pr = halftick_bt;
-		else
-			bintime_mul(&pr, to_ticks);
+		} else {
+			to_ticks >>= C_PRELGET(flags);
+			if (to_ticks == 0)
+				pr = halftick_bt;
+			else
+				bintime_mul(&pr, to_ticks);
+		}
 	} else { 
 		to_bt = *bt;
 		if (precision != NULL)


More information about the svn-src-projects mailing list