diff options
author | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-02-18 03:45:09 +0000 |
---|---|---|
committer | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-02-18 03:45:09 +0000 |
commit | ca243bad636ab175706618a4afd6fe0e63de5bdf (patch) | |
tree | 55a00b2ccd8ab6a7b11dec562e2d7f78177bfbf8 | |
parent | 1d5766b47264845e0f0943f4d47bead1f66a8800 (diff) |
Don't do unnecessary normalization. ok art@
-rw-r--r-- | sys/kern/kern_clock.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 1dcb92ef9a5..f786f4af760 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.33 2002/02/15 20:55:26 nordin Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.34 2002/02/18 03:45:08 nordin Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -794,13 +794,9 @@ tvtohz(struct timeval *tv) */ sec = tv->tv_sec; usec = tv->tv_usec; - if (usec < 0) { - sec--; - usec += 1000000; - } - if (sec < 0 || (sec == 0 && usec <= 0)) { + if (sec < 0 || (sec == 0 && usec <= 0)) ticks = 0; - } else if (sec <= LONG_MAX / 1000000) + else if (sec <= LONG_MAX / 1000000) ticks = (sec * 1000000 + (unsigned long)usec + (tick - 1)) / tick + 1; else if (sec <= LONG_MAX / hz) |