From e95b8efc6b2e7503de2f13ee82e67205a2eab97e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 20 Mar 2011 15:00:13 +0900 Subject: [PATCH] Fixed the bug that microsecond part of timeval overwlows in waitData(). --- src/DownloadEngine.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index 298089e98..7738701ca 100644 --- a/src/DownloadEngine.cc +++ b/src/DownloadEngine.cc @@ -178,8 +178,9 @@ void DownloadEngine::waitData() if(noWait_) { tv.tv_sec = tv.tv_usec = 0; } else { - tv.tv_sec = 0; - tv.tv_usec = refreshInterval_*1000; + lldiv_t qr = lldiv(refreshInterval_*1000, 1000000); + tv.tv_sec = qr.quot; + tv.tv_usec = qr.rem; } eventPoll_->poll(tv); }