summaryrefslogtreecommitdiffstats
path: root/src/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c
index 5988aef9..c8376c8a 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -141,10 +141,10 @@ int osmo_timer_remaining(const struct osmo_timer_list *timer,
{
struct timeval current_time;
- if (!now) {
+ if (!now)
gettimeofday(&current_time, NULL);
- now = &current_time;
- }
+ else
+ current_time = *now;
timersub(&timer->timeout, &current_time, remaining);