From dfc7a13286177d68c156cc76be9e4f3050f8efb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 30 Dec 2010 21:35:53 +0100 Subject: [PATCH] usleep: use nanosleep instead of usleep as the usleep is obsolete. Ticket: #2283 --- cli/threadexecutor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index 998c300a2..f1dd97aa5 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #endif ThreadExecutor::ThreadExecutor(const std::vector &filenames, const Settings &settings, ErrorLogger &errorLogger) @@ -190,7 +191,12 @@ unsigned int ThreadExecutor::check() if (readRes == -1) break; else if (readRes == 0) - usleep(5000); // 5 ms + { + struct timespec duration; + duration.tv_sec = 0; + duration.tv_nsec = 5 * 1000 * 1000; // 5 ms + nanosleep(&duration, NULL); + } } int stat = 0;