summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-10-31 10:32:02 -0600
committerAndreas Kling <kling@serenityos.org>2020-11-30 13:17:02 +0100
commite0e26c6c679cad38c809ff3d898d135e505c67ff (patch)
tree88821927a9c2cc2ae7a5038d42ee1e21a8bb26bc
parentc1276559baea803b6bb93411544ab56750e7278a (diff)
downloadserenity-e0e26c6c679cad38c809ff3d898d135e505c67ff.zip
LibCore: Don't wait for negative amount of time
-rw-r--r--Libraries/LibCore/EventLoop.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp
index e5b3b7428f..646e8d3e8c 100644
--- a/Libraries/LibCore/EventLoop.cpp
+++ b/Libraries/LibCore/EventLoop.cpp
@@ -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;
}