From 955fdb039e7ac18322bc37e411c216702fb158a3 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Mon, 17 Oct 2011 23:03:57 +0200 Subject: [PATCH] timer: Fix implementation of osmo_timers_nearest causing high CPU load Signed-off-by: Sylvain Munaut --- src/timer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/timer.c b/src/timer.c index 685298336..d1a4e7e0d 100644 --- a/src/timer.c +++ b/src/timer.c @@ -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)