Date: Sun, 11 Jan 2015 20:48:30 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277025 - head/sys/kern Message-ID: <201501112048.t0BKmUEG038087@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501112048.t0BKmUEG038087>