call fdopen() after FileFd was checked
authorMichael Vogt <mvo@debian.org>
Thu, 25 Jul 2013 18:36:23 +0000 (20:36 +0200)
committerMichael Vogt <mvo@debian.org>
Thu, 25 Jul 2013 18:36:23 +0000 (20:36 +0200)
apt-pkg/indexcopy.cc

index 1d61b97..a2adb2d 100644 (file)
@@ -714,9 +714,9 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,   /*{{{*/
       } else {
         Target.Open(TargetF,FileFd::WriteAtomic);
       }
-      FILE *TargetFl = fdopen(dup(Target.Fd()),"w");
       if (_error->PendingError() == true)
         return false;
+      FILE *TargetFl = fdopen(dup(Target.Fd()),"w");
       if (TargetFl == 0)
         return _error->Errno("fdopen","Failed to reopen fd");