diff options
author | brian <brian@cvs.openbsd.org> | 1997-12-29 22:23:42 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1997-12-29 22:23:42 +0000 |
commit | 247d9291cb6ad112905c000166015a4ff3e0cd0b (patch) | |
tree | 234ca249fb408979e1bba1608dcec08b6d7248b3 /usr.sbin | |
parent | 616e3392f75cac20765939a1807a283aaae71608 (diff) |
Don't complain that someone's changed the clock unless the time
after a select() interrupt is more than 1 second past what
should have been the end time.
We may just be running on an over-burdened machine.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/timer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c index 1a1516639b6..c6c71e88717 100644 --- a/usr.sbin/ppp/timer.c +++ b/usr.sbin/ppp/timer.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: timer.c,v 1.2 1997/12/28 21:54:24 brian Exp $ + * $Id: timer.c,v 1.3 1997/12/29 22:23:41 brian Exp $ * * TODO: */ @@ -224,8 +224,8 @@ nointr_dosleep(u_int sec, u_int usec) break; } else { gettimeofday(&to, NULL); - if (to.tv_sec > et.tv_sec || - (to.tv_sec == et.tv_sec && to.tv_usec > et.tv_usec) || + if (to.tv_sec > et.tv_sec + 1 || + (to.tv_sec == et.tv_sec + 1 && to.tv_usec > et.tv_usec) || to.tv_sec < st.tv_sec || (to.tv_sec == st.tv_sec && to.tv_usec < st.tv_usec)) { LogPrintf(LogWARN, "Clock adjusted between %d and %d seconds " @@ -237,7 +237,8 @@ nointr_dosleep(u_int sec, u_int usec) et.tv_usec = st.tv_usec + usec; to.tv_sec = sec; to.tv_usec = usec; - } else if (to.tv_sec == et.tv_sec && to.tv_usec == et.tv_usec) { + } else if (to.tv_sec > et.tv_sec || + (to.tv_sec == et.tv_sec && to.tv_usec >= et.tv_usec)) { break; } else { to.tv_sec = et.tv_sec - to.tv_sec; |