summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-10-21 16:54:28 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-10-21 16:54:28 +0200
commit4260fd3972cc0c01e6cbc825063c06311d440f9b (patch)
tree2feb39cfd211f8afaf3f8b329d932e972802a07b /methods
parent95fe33dc131bee1a0917ba647e44855c10083ab5 (diff)
* apt-pkg/contrib/fileutl.cc:
- Add a FileFd::FileSize() method to get the size of the underlying file and not the size of the content in the file as FileFd::Size() does - the sizes can differ since the direct gzip integration * methods/{gzip,bzip2}.cc: - use FileSize() to determine if the file is invalid (Closes: #600852)
Diffstat (limited to 'methods')
-rw-r--r--methods/bzip2.cc2
-rw-r--r--methods/gzip.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/methods/bzip2.cc b/methods/bzip2.cc
index c668141a2..ccc3669a2 100644
--- a/methods/bzip2.cc
+++ b/methods/bzip2.cc
@@ -57,7 +57,7 @@ bool Bzip2Method::Fetch(FetchItem *Itm)
FileFd From(Path,FileFd::ReadOnly);
// FIXME add an error message saying that empty files can't be valid archives
- if(From.Size() == 0)
+ if(From.FileSize() == 0)
return false;
int GzOut[2];
diff --git a/methods/gzip.cc b/methods/gzip.cc
index 22cae9424..f1c76066e 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -49,7 +49,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
FileFd From(Path,FileFd::ReadOnlyGzip);
// FIXME add an error message saying that empty files can't be valid archives
- if(From.Size() == 0)
+ if(From.FileSize() == 0)
return false;
FileFd To(Itm->DestFile,FileFd::WriteAtomic);