diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-03-20 15:00:13 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-03-20 15:00:13 +0900 |
| commit | e95b8efc6b2e7503de2f13ee82e67205a2eab97e (patch) | |
| tree | d8fbfebf2aeda63fddadfc5a7255e69ece827dfb | |
| parent | 93b1a2b0b008aace2a40f5edc7bbfd12c4fadb1e (diff) | |
Fixed the bug that microsecond part of timeval overwlows in waitData().
| -rw-r--r-- | src/DownloadEngine.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index 298089e9..7738701c 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); } |
