summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/timer.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-12-29 22:23:52 +0000
committerbrian <brian@FreeBSD.org>1997-12-29 22:23:52 +0000
commit8209f48d4955d14e7252924e4649a83f814aac35 (patch)
treeb0212b9b666d33a75e797f754fafddd7a4b3665e /usr.sbin/ppp/timer.c
parentbb76302c2dd51eabb0ac42e6cae5a4399d1f92ff (diff)
downloadFreeBSD-src-8209f48d4955d14e7252924e4649a83f814aac35.zip
FreeBSD-src-8209f48d4955d14e7252924e4649a83f814aac35.tar.gz
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/ppp/timer.c')
-rw-r--r--usr.sbin/ppp/timer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 7a252a2..ac7b089 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.24 1997/11/22 03:37:52 brian Exp $
+ * $Id: timer.c,v 1.25 1997/12/28 21:55:04 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;
OpenPOWER on IntegriCloud