diff options
Diffstat (limited to 'usr.sbin/ppp/timer.c')
-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; |