From 60fc4f21783fddaae481494f99ec157e08a9bfdb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 25 Jul 2013 20:41:03 +0200 Subject: apt-pkg/indexcopy.cc: check for pending errors before calling fdopen() --- apt-pkg/indexcopy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index a2adb2d00..4920efff8 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -106,9 +106,9 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &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"); -- cgit v1.2.3