timer: Fix implementation of osmo_timers_nearest causing high CPU load

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2011-10-17 23:03:57 +02:00
parent 16df917131
commit 955fdb039e
1 changed files with 2 additions and 4 deletions

View File

@ -132,12 +132,10 @@ int osmo_timer_pending(struct osmo_timer_list *timer)
*/
struct timeval *osmo_timers_nearest(void)
{
static struct timeval no_timers = { 0, 0 };
if (nearest_p != NULL && !timerisset(nearest_p))
if (nearest_p != NULL)
return nearest_p;
else
return &no_timers;
return NULL;
}
static void update_nearest(struct timeval *cand, struct timeval *current)