diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-07-05 13:24:52 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-07-05 13:47:27 +0200 |
commit | 80ce950887824a120c8de07dac9191e7fff72de4 (patch) | |
tree | 72b546c8d7ec8321c0692248e266f46648f0c5a3 /unix/x0vncserver | |
parent | 60962a99dde101099bc775dd98354a43b9b36c9a (diff) | |
download | tigervnc-80ce950887824a120c8de07dac9191e7fff72de4.tar.gz tigervnc-80ce950887824a120c8de07dac9191e7fff72de4.zip |
Fix x0vncserver handling of timers
Bug fix for bf28683.
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 49c95137..802ea252 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -413,7 +413,7 @@ int main(int argc, char** argv) if (!clients_connected) sched.reset(); - wait_ms = 0; + wait_ms = -1; if (sched.isRunning()) { wait_ms = sched.millisRemaining(); @@ -424,7 +424,7 @@ int main(int argc, char** argv) // Trigger timers and check when the next will expire nextTimeout = Timer::checkTimeouts(); - if (nextTimeout >= 0 && nextTimeout < wait_ms) + if (nextTimeout >= 0 && (wait_ms == -1 || nextTimeout < wait_ms)) wait_ms = nextTimeout; tv.tv_sec = wait_ms / 1000; @@ -433,7 +433,7 @@ int main(int argc, char** argv) // Do the wait... sched.sleepStarted(); int n = select(FD_SETSIZE, &rfds, &wfds, nullptr, - wait_ms ? &tv : nullptr); + wait_ms >= 0 ? &tv : nullptr); sched.sleepFinished(); if (n < 0) { |