diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-07-23 21:36:24 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-07-23 21:42:47 +0900 |
| commit | 860f4dd06ace859470e118d4b9a8d10ddf92d076 (patch) | |
| tree | 1effdc3fd73160b57f5d6d109662a66e33050d08 /src/FallocFileAllocationIterator.cc | |
| parent | f56743b0833551aa6845d0a4f1d05da02cb52175 (diff) | |
Use int64_t instead of off_t
Using off_t, at least, in DiskAdaptor layer is problematic because
torrent can contain under 2GiB files but total sum of those files may
exceed 2GiB limit, which makes off_t overflow in 32 bit system without
large file support. So we use int64_t in API. We'll check the file
length before download so that it does not exceed max off_t.
Diffstat (limited to 'src/FallocFileAllocationIterator.cc')
| -rw-r--r-- | src/FallocFileAllocationIterator.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FallocFileAllocationIterator.cc b/src/FallocFileAllocationIterator.cc index f337bf7a..64d0a5ab 100644 --- a/src/FallocFileAllocationIterator.cc +++ b/src/FallocFileAllocationIterator.cc @@ -38,7 +38,7 @@ namespace aria2 { FallocFileAllocationIterator::FallocFileAllocationIterator -(BinaryStream* stream, off_t offset, off_t totalLength): +(BinaryStream* stream, int64_t offset, int64_t totalLength): stream_(stream), offset_(offset), totalLength_(totalLength) {} void FallocFileAllocationIterator::allocateChunk() @@ -57,12 +57,12 @@ bool FallocFileAllocationIterator::finished() return offset_ == totalLength_; } -off_t FallocFileAllocationIterator::getCurrentLength() +int64_t FallocFileAllocationIterator::getCurrentLength() { return offset_; } -off_t FallocFileAllocationIterator::getTotalLength() +int64_t FallocFileAllocationIterator::getTotalLength() { return totalLength_; } |
