From 22041bd2864b8d0b401b45dde9eda4003a11fec4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 10 Aug 2010 14:59:56 +0200 Subject: apt-pkg, methods: Convert users of WriteEmpty to WriteAtomic. --- methods/bzip2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods/bzip2.cc') diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 5da214bfc..19e49828e 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -91,7 +91,7 @@ bool Bzip2Method::Fetch(FetchItem *Itm) close(GzOut[1]); FileFd FromGz(GzOut[0]); // For autoclose - FileFd To(Itm->DestFile,FileFd::WriteEmpty); + FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) return false; -- cgit v1.2.3 From 6802b90c0871726f0018b2c3c059bf8c95a4a710 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 16 Aug 2010 12:12:51 +0200 Subject: * methods/bzip2.cc: - fix error checking for read in case of failing bzip2/lzma/whatever MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotted by -Wextra: bzip2.cc: In member function ‘virtual bool Bzip2Method::Fetch(pkgAcqMethod::FetchItem*)’: bzip2.cc:108:19: warning: comparison of unsigned expression < 0 is always false bzip2.cc:111:19: warning: comparison of unsigned expression < 0 is always false --- methods/bzip2.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'methods/bzip2.cc') diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 19e49828e..241f21c66 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -102,9 +102,8 @@ bool Bzip2Method::Fetch(FetchItem *Itm) while (1) { unsigned char Buffer[4*1024]; - unsigned long Count; - Count = read(GzOut[0],Buffer,sizeof(Buffer)); + ssize_t Count = read(GzOut[0],Buffer,sizeof(Buffer)); if (Count < 0 && errno == EINTR) continue; -- cgit v1.2.3