]> git.saurik.com Git - apt.git/commitdiff
apt-pkg/indexcopy.cc: check for pending errors before calling fdopen()
authorMichael Vogt <mvo@debian.org>
Thu, 25 Jul 2013 18:41:03 +0000 (20:41 +0200)
committerMichael Vogt <mvo@debian.org>
Thu, 25 Jul 2013 18:41:03 +0000 (20:41 +0200)
apt-pkg/indexcopy.cc

index a2adb2d0031fee4f3b3384f21663f4f26a61ed1c..4920efff866243689a284f91a912a07ea581477c 100644 (file)
@@ -106,9 +106,9 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
       } 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");