svn commit: r277025 - head/sys/kern
Ian Lepore
ian at FreeBSD.org
Sun Jan 11 20:48:31 UTC 2015
Author: ian
Date: Sun Jan 11 20:48:29 2015
New Revision: 277025
URL: https://svnweb.freebsd.org/changeset/base/277025
Log:
Fix an off by one in ppsratecheck(). If you asked for N=1 you'd get one,
but for any N>1 you'd get N-1 packets/events per second.
Modified:
head/sys/kern/kern_time.c
Modified: head/sys/kern/kern_time.c
==============================================================================
--- head/sys/kern/kern_time.c Sun Jan 11 20:35:34 2015 (r277024)
+++ head/sys/kern/kern_time.c Sun Jan 11 20:48:29 2015 (r277025)
@@ -982,7 +982,7 @@ ppsratecheck(struct timeval *lasttime, i
return (maxpps != 0);
} else {
(*curpps)++; /* NB: ignore potential overflow */
- return (maxpps < 0 || *curpps < maxpps);
+ return (maxpps < 0 || *curpps <= maxpps);
}
}
More information about the svn-src-all
mailing list