summaryrefslogtreecommitdiff
path: root/src/DefaultDiskWriter.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:36:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:42:47 +0900
commit860f4dd06ace859470e118d4b9a8d10ddf92d076 (patch)
tree1effdc3fd73160b57f5d6d109662a66e33050d08 /src/DefaultDiskWriter.cc
parentf56743b0833551aa6845d0a4f1d05da02cb52175 (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/DefaultDiskWriter.cc')
-rw-r--r--src/DefaultDiskWriter.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/DefaultDiskWriter.cc b/src/DefaultDiskWriter.cc
index afa02072..7e3d4d14 100644
--- a/src/DefaultDiskWriter.cc
+++ b/src/DefaultDiskWriter.cc
@@ -41,7 +41,7 @@ DefaultDiskWriter::DefaultDiskWriter(const std::string& filename):
DefaultDiskWriter::~DefaultDiskWriter() {}
-void DefaultDiskWriter::initAndOpenFile(off_t totalLength)
+void DefaultDiskWriter::initAndOpenFile(int64_t totalLength)
{
createFile();
}