summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-11-19 23:21:13 +0000
committerBrian Somers <brian@FreeBSD.org>1999-11-19 23:21:13 +0000
commit83569b351c4f9868b043e7c48e90d5ba56da9838 (patch)
tree4e77eac5bf83451ce692dad96e3d30490fbca8e6
parentf94f8efc61f135820d2c086e36422f19b932f20c (diff)
Notes
-rw-r--r--usr.sbin/ppp/timer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index a0f039d87073..7a7d592fdfaa 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -62,6 +62,7 @@ timer_Stop(struct pppTimer *tp)
void
timer_Start(struct pppTimer *tp)
{
+ struct itimerval itimer;
struct pppTimer *t, *pt;
u_long ticks = 0;
int omask;
@@ -76,6 +77,12 @@ timer_Start(struct pppTimer *tp)
sigsetmask(omask);
return;
}
+
+ /* Adjust our first delta so that it reflects what's really happening */
+ if (TimerList && getitimer(ITIMER_REAL, &itimer) == 0)
+ TimerList->rest = itimer.it_value.tv_sec * SECTICKS +
+ itimer.it_value.tv_usec / TICKUNIT;
+
pt = NULL;
for (t = TimerList; t; t = t->next) {
if (ticks + t->rest >= tp->load)
@@ -99,7 +106,7 @@ timer_Start(struct pppTimer *tp)
pt->next = tp;
} else {
TimerList = tp;
- timer_InitService(0); /* Start the Timer Service */
+ timer_InitService(t != NULL); /* [re]Start the Timer Service */
}
if (t)
t->rest -= tp->rest;