From ea54214002c09eeb4dd498d97a564471ec9993c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 10:09:00 +0200 Subject: reorder includes: add if needed and include it at first --- apt-pkg/contrib/hashsum.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/contrib/hashsum.cc') diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index 728747d7a..28f711176 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -1,4 +1,5 @@ // Cryptographic API Base +#include #include #include "hashsum_template.h" -- cgit v1.2.3 From 650faab01603caac04494d54cf6b10a65c00ea13 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 17:46:48 +0200 Subject: Support large files in the complete toolset. Indexes of this size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895) --- apt-pkg/contrib/hashsum.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/contrib/hashsum.cc') diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index 28f711176..0edcbb364 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -7,16 +7,16 @@ // Summation::AddFD - Add content of file into the checksum /*{{{*/ // --------------------------------------------------------------------- /* */ -bool SummationImplementation::AddFD(int const Fd, unsigned long Size) { +bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) { unsigned char Buf[64 * 64]; - int Res = 0; + ssize_t Res = 0; int ToEOF = (Size == 0); while (Size != 0 || ToEOF) { - unsigned n = sizeof(Buf); - if (!ToEOF) n = min(Size,(unsigned long)n); + unsigned long long n = sizeof(Buf); + if (!ToEOF) n = min(Size, n); Res = read(Fd, Buf, n); - if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read + if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read return false; if (ToEOF && Res == 0) // EOF break; -- cgit v1.2.3