mirror of
https://github.com/netfun2000/lcd4linux.git
synced 2026-02-27 09:44:34 +08:00
BUG: handle negative delays in timer_process() (timer.c)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1105 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
@@ -210,6 +210,10 @@ int timer_process(struct timespec *delay)
|
||||
struct timeval diff;
|
||||
timersub(&Timers[min].when, &now, &diff);
|
||||
|
||||
/* for negative delays, directly trigger next update */
|
||||
if ((diff.tv_sec < 0) || (diff.tv_usec < 0))
|
||||
timerclear(&diff);
|
||||
|
||||
delay->tv_sec = diff.tv_sec;
|
||||
/* microseconds to nanoseconds!! */
|
||||
delay->tv_nsec = diff.tv_usec * 1000;
|
||||
|
||||
Reference in New Issue
Block a user