diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2011-10-17 23:03:57 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2011-10-17 23:03:57 +0200 |
commit | 955fdb039e7ac18322bc37e411c216702fb158a3 (patch) | |
tree | 4d15932a0e2cbbc5257a0c2682627457e0ab3439 | |
parent | 16df9171312c2489ec825cb962ced1f1220a2691 (diff) |
timer: Fix implementation of osmo_timers_nearest causing high CPU load
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | src/timer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/timer.c b/src/timer.c index 68529833..d1a4e7e0 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) |