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
This commit is contained in:
XANTRONIX Development 2020-07-31 01:07:38 -04:00 committed by XANTRONIX Industrial
parent d6fbea1824
commit 55d40749a4

View file

@ -16,12 +16,8 @@ void patty_timer_start(struct timeval *timer,
timer->tv_usec = (ms % 1000) * 1000; timer->tv_usec = (ms % 1000) * 1000;
if (timercmp(timer, target, >)) { if (timercmp(timer, target, >)) {
struct timeval res; target->tv_sec = timer->tv_sec;
target->tv_usec = timer->tv_usec;
timeradd(timer, target, &res);
timer->tv_sec = res.tv_sec;
timer->tv_usec = res.tv_usec;
} }
} }