LibCore: Don't wait for negative amount of time

This commit is contained in:
Tom 2020-10-31 10:32:02 -06:00 committed by Andreas Kling
parent c1276559ba
commit e0e26c6c67
Notes: sideshowbarker 2024-07-19 01:09:01 +09:00

View file

@ -584,7 +584,7 @@ retry:
now.tv_sec = now_spec.tv_sec;
now.tv_usec = now_spec.tv_nsec / 1000;
timeval_sub(next_timer_expiration.value(), now, timeout);
if (timeout.tv_sec < 0) {
if (timeout.tv_sec < 0 || (timeout.tv_sec == 0 && timeout.tv_usec < 0)) {
timeout.tv_sec = 0;
timeout.tv_usec = 0;
}