summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-06-29 14:46:34 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-06-29 14:46:34 +0200
commitfc5db01bb7d1546944200d197866b0b5c378f100 (patch)
treead044e6819655d1fddeb3331680557b934a2666f /apt-pkg/contrib/fileutl.cc
parentcfc6566d5097ef5518e12f5c1e5f15a8f5b182cf (diff)
don't do atomic overrides with failed files
We deploy atomic renames for some files, but these renames also happen if something about the file failed which isn't really the point of the exercise… Closes: 828908
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 94d1432cf..388849144 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -2623,7 +2623,7 @@ bool FileFd::Close()
}
if ((Flags & Replace) == Replace) {
- if (rename(TemporaryFileName.c_str(), FileName.c_str()) != 0)
+ if (Failed() == false && rename(TemporaryFileName.c_str(), FileName.c_str()) != 0)
Res &= _error->Errno("rename",_("Problem renaming the file %s to %s"), TemporaryFileName.c_str(), FileName.c_str());
FileName = TemporaryFileName; // for the unlink() below.