diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2005-10-27 14:57:13 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2005-10-27 14:57:13 +0000 |
commit | 71ae89ffa55224bb644f2c58af17c824d7de6c01 (patch) | |
tree | 4b173da9a7ba0a6f277ac79e9b647d49ffe87b02 /sys/kern | |
parent | 08482f721146e0abb8b395c808fa2e641fb8548f (diff) |
make sure ppsratecheck() returns 0 if maxpps is 0;
from alexander bluhm; ok deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_time.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |