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:
parent
d6fbea1824
commit
55d40749a4
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue