mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18:06 +00:00
cfm: Replace recv_time with a flag.
This makes the code more obviously correct in my opinion. This patch also removes timer_enabled_at() along with its only user.
This commit is contained in:
13
lib/timer.c
13
lib/timer.c
@@ -40,16 +40,3 @@ timer_wait(const struct timer *timer)
|
||||
poll_timer_wait_until(timer->t);
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns the time at which 'timer' was set with 'duration'. Infinite timers
|
||||
* were enabled at time LLONG_MAX. Manually expired timers were enabled at
|
||||
* LLONG_MIN. */
|
||||
long long int
|
||||
timer_enabled_at(const struct timer *timer, long long int duration)
|
||||
{
|
||||
switch (timer->t) {
|
||||
case LLONG_MAX: return LLONG_MAX;
|
||||
case LLONG_MIN: return LLONG_MIN;
|
||||
default: return timer->t - duration;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user