diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-12-17 23:53:31 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-12-17 23:53:31 +0100 |
commit | 109eb1511d0cdfa4af3196105cada30bcbb77bc8 (patch) | |
tree | c07319a3ddc9a6484561d1cea918aaecade4a7e9 /ftparchive | |
parent | 1abbc47c045770476f5f9a57c58989d13290d51b (diff) | |
download | apt-109eb1511d0cdfa4af3196105cada30bcbb77bc8.tar.gz |
try to avoid direct usage of .Fd() if possible and do read()s and co
on the FileFd instead
Diffstat (limited to 'ftparchive')
-rw-r--r-- | ftparchive/cachedb.cc | 8 | ||||
-rw-r--r-- | ftparchive/writer.cc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index f0bfa2a6d..a8b637a80 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -351,7 +351,7 @@ bool CacheDB::GetMD5(bool const &GenOnly) return false; } MD5Summation MD5; - if (Fd->Seek(0) == false || MD5.AddFD(Fd->Fd(),CurStat.FileSize) == false) + if (Fd->Seek(0) == false || MD5.AddFD(*Fd, CurStat.FileSize) == false) return false; MD5Res = MD5.Result(); @@ -382,7 +382,7 @@ bool CacheDB::GetSHA1(bool const &GenOnly) return false; } SHA1Summation SHA1; - if (Fd->Seek(0) == false || SHA1.AddFD(Fd->Fd(),CurStat.FileSize) == false) + if (Fd->Seek(0) == false || SHA1.AddFD(*Fd, CurStat.FileSize) == false) return false; SHA1Res = SHA1.Result(); @@ -413,7 +413,7 @@ bool CacheDB::GetSHA256(bool const &GenOnly) return false; } SHA256Summation SHA256; - if (Fd->Seek(0) == false || SHA256.AddFD(Fd->Fd(),CurStat.FileSize) == false) + if (Fd->Seek(0) == false || SHA256.AddFD(*Fd, CurStat.FileSize) == false) return false; SHA256Res = SHA256.Result(); @@ -444,7 +444,7 @@ bool CacheDB::GetSHA512(bool const &GenOnly) return false; } SHA512Summation SHA512; - if (Fd->Seek(0) == false || SHA512.AddFD(Fd->Fd(),CurStat.FileSize) == false) + if (Fd->Seek(0) == false || SHA512.AddFD(*Fd, CurStat.FileSize) == false) return false; SHA512Res = SHA512.Result(); diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 02777713c..159772991 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -1035,7 +1035,7 @@ bool ReleaseWriter::DoPackage(string FileName) CheckSums[NewFileName].size = fd.Size(); Hashes hs; - hs.AddFD(fd.Fd(), 0, DoMD5, DoSHA1, DoSHA256, DoSHA512); + hs.AddFD(fd, 0, DoMD5, DoSHA1, DoSHA256, DoSHA512); if (DoMD5 == true) CheckSums[NewFileName].MD5 = hs.MD5.Result(); if (DoSHA1 == true) |