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 +- methods/copy.cc | 2 +- methods/gzip.cc | 2 +- methods/rred.cc | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'methods') 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; diff --git a/methods/copy.cc b/methods/copy.cc index 027b59f46..a6bb372a3 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -52,7 +52,7 @@ bool CopyMethod::Fetch(FetchItem *Itm) // See if the file exists FileFd From(File,FileFd::ReadOnly); - FileFd To(Itm->DestFile,FileFd::WriteEmpty); + FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) { diff --git a/methods/gzip.cc b/methods/gzip.cc index 72e3ac909..5b9b66b50 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -55,7 +55,7 @@ bool GzipMethod::Fetch(FetchItem *Itm) return true; } - FileFd To(Itm->DestFile,FileFd::WriteEmpty); + FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) return false; diff --git a/methods/rred.cc b/methods/rred.cc index f42c7a072..d51c45c85 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -446,7 +446,7 @@ bool RredMethod::Fetch(FetchItem *Itm) /*{{{*/ // the cleanup/closing of the fds) FileFd From(Path,FileFd::ReadOnly); FileFd Patch(Path+".ed",FileFd::ReadOnly); - FileFd To(Itm->DestFile,FileFd::WriteEmpty); + FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) return false; @@ -458,7 +458,7 @@ bool RredMethod::Fetch(FetchItem *Itm) /*{{{*/ // retry with patchFile lseek(Patch.Fd(), 0, SEEK_SET); lseek(From.Fd(), 0, SEEK_SET); - To.Open(Itm->DestFile,FileFd::WriteEmpty); + To.Open(Itm->DestFile,FileFd::WriteAtomic); if (_error->PendingError() == true) return false; if (patchFile(Patch, From, To, &Hash) != ED_OK) { -- cgit v1.2.3