mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-10 23:49:47 +00:00
LibCore: CEventLoop: If timeval_sub makes tv_sec negative, use 0
This commit is contained in:
committed by
Andreas Kling
parent
0c4c5b5eb7
commit
dac07a5d76
@@ -371,6 +371,10 @@ void EventLoop::wait_for_event(WaitMode mode)
|
||||
gettimeofday(&now, nullptr);
|
||||
get_next_timer_expiration(timeout);
|
||||
timeval_sub(timeout, now, timeout);
|
||||
if (timeout.tv_sec < 0) {
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 0;
|
||||
}
|
||||
} else {
|
||||
should_wait_forever = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user