summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-08-05 12:36:46 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-08-05 12:36:46 +0200
commitd5da93b83f886b87958e52d4658b9f08b255b36c (patch)
tree8858674d35e661f215c3996b4195b1873c35bcb9 /apt-pkg
parent666faa35f8a42d2a8691daf46a203be6d29166dc (diff)
* apt-pkg/indexcopy.cc:
- do not use atomic writing if the target is /dev/null as we don't want to replace it, not even automically. (Closes: #683410)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/indexcopy.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index e29e2819c..c97445326 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -810,9 +810,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
(*I).c_str() + CDROM.length());
string TargetF = _config->FindDir("Dir::State::lists") + "partial/";
TargetF += URItoFileName(S);
+ FileFd Target;
if (_config->FindB("APT::CDROM::NoAct",false) == true)
+ {
TargetF = "/dev/null";
- FileFd Target(TargetF,FileFd::WriteAtomic);
+ Target.Open(TargetF,FileFd::WriteExists);
+ } else {
+ Target.Open(TargetF,FileFd::WriteAtomic);
+ }
FILE *TargetFl = fdopen(dup(Target.Fd()),"w");
if (_error->PendingError() == true)
return false;