From 55d40749a455b4a6cbc3795ee1a32499311cb52f Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 31 Jul 2020 01:07:38 -0400 Subject: [PATCH] Fix patty_timer_start() Fix patty_timer_start() to only set the running timer to the value of the timer being started, rather than adding the value of the started timer to the running timer --- src/timer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/timer.c b/src/timer.c index deffcf3..dcb9fa0 100644 --- a/src/timer.c +++ b/src/timer.c @@ -16,12 +16,8 @@ void patty_timer_start(struct timeval *timer, timer->tv_usec = (ms % 1000) * 1000; if (timercmp(timer, target, >)) { - struct timeval res; - - timeradd(timer, target, &res); - - timer->tv_sec = res.tv_sec; - timer->tv_usec = res.tv_usec; + target->tv_sec = timer->tv_sec; + target->tv_usec = timer->tv_usec; } }