Use a helper function to add milliseconds to timeval structs

This commit is contained in:
Tobias Brunner
2012-10-18 12:25:59 +02:00
parent 2b6088c718
commit eecd41e349
6 changed files with 22 additions and 37 deletions
@@ -285,12 +285,7 @@ static void fire_roam_event(private_kernel_pfroute_net_t *this, bool address)
time_monotonic(&now);
if (timercmp(&now, &this->last_roam, >))
{
now.tv_usec += ROAM_DELAY * 1000;
while (now.tv_usec > 1000000)
{
now.tv_sec++;
now.tv_usec -= 1000000;
}
timeval_add_ms(&now, ROAM_DELAY);
this->last_roam = now;
job = (job_t*)callback_job_create((callback_job_cb_t)roam_event,