From 585733bcca21d83568f7c30ec7fa0fd1d8ca930b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 27 Oct 2014 09:29:29 +0100 Subject: guard against negative sleep amount --- opentrack/tracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opentrack/tracker.cpp') diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index c96bb9b4..bb7a15c6 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -198,7 +198,7 @@ void Tracker::run() { logic(); long q = sleep_ms * 1000L - t.elapsed()/1000L; - usleep(q); + usleep(std::max(1L, q)); } { -- cgit v1.2.3