From ba67259acb76741f2d690eb9e05a311c086262cf Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 26 Nov 2021 15:14:00 +0100 Subject: ProcessHandle::Wait() wasn't waiting indefinitely with a <0 timeout --- zencore/thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zencore/thread.cpp') diff --git a/zencore/thread.cpp b/zencore/thread.cpp index ee62b5248..0f2dc7181 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -585,7 +585,7 @@ ProcessHandle::Wait(int TimeoutMs) timespec SleepTime = { 0, SleepMs * 1000 * 1000 }; for (int i = 0; ; i += SleepMs) { - if (i >= TimeoutMs) + if (TimeoutMs >= 0 && i >= TimeoutMs) { return false; } -- cgit v1.2.3