diff --git a/src/aria2.cpp b/src/aria2.cpp index 06a3b9611..8074967aa 100644 --- a/src/aria2.cpp +++ b/src/aria2.cpp @@ -3,8 +3,7 @@ #include "aria2.h" #include "xmlrpc.h" #include -#include -#include +#include #include #include #include // For AriaError @@ -82,7 +81,8 @@ Aria2::Aria2(): int watchdog = 50; while(--watchdog) { - std::this_thread::sleep_for(std::chrono::microseconds(10000)); + struct timespec wait = {0, 10000000}; + nanosleep(&wait, nullptr); auto res = curl_easy_perform(mp_curl); if (res == CURLE_OK) { break;