Re-try with a constant 10 us until the timeout is reached instead of a timeout-dependent wait time.
Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> --- src/process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index 1a1739a..284ecbd 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -127,14 +127,14 @@ void xorg::testing::Process::Start(const std::string& program, ...) { } bool xorg::testing::Process::WaitForExit(unsigned int timeout) { - for (int i = 0; i < 10; i++) { + for (int i = 0; i < timeout * 100; i++) { int status; int pid = waitpid(Pid(), &status, WNOHANG); if (pid == Pid()) return true; - usleep(timeout * 100); + usleep(10); } return false; -- 1.7.11.2 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel