From 71ae89ffa55224bb644f2c58af17c824d7de6c01 Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Thu, 27 Oct 2005 14:57:13 +0000 Subject: make sure ppsratecheck() returns 0 if maxpps is 0; from alexander bluhm; ok deraadt --- sys/kern/kern_time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index d120439768c..a7b0f7425c7 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.50 2005/10/13 18:17:15 aaron Exp $ */ +/* $OpenBSD: kern_time.c,v 1.51 2005/10/27 14:57:12 markus Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -751,7 +751,9 @@ ppsratecheck(lasttime, curpps, maxpps) * we do increment *curpps even in *curpps < maxpps case, as some may * try to use *curpps for stat purposes as well. */ - if ((lasttime->tv_sec == 0 && lasttime->tv_usec == 0) || + if (maxpps == 0) + rv = 0; + else if ((lasttime->tv_sec == 0 && lasttime->tv_usec == 0) || delta.tv_sec >= 1) { *lasttime = tv; *curpps = 0; -- cgit v1.2.3