summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-11-04 14:47:59 +0100
committerMichael Vogt <mvo@ubuntu.com>2014-11-04 14:47:59 +0100
commit53702a590c9905cf3104180fefcf126b26e3aad9 (patch)
tree2d824321b7234cecf008b120e356d5b876280ff7 /apt-pkg/acquire-item.cc
parent359e1c4f1f8880b62b430f46680df14f94664906 (diff)
Call "Dequeue()" for items in AbortTransaction() to fix race
The pkgAcquire::Run() code works uses a while(ToFetch > 0) loop over the items queued for fetching. This means that we need to Deqeueue the item if we call AbortTransaction() to avoid a hang.
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index ba1669de0..f684e81f1 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1547,7 +1547,10 @@ void pkgAcqMetaBase::AbortTransaction()
std::clog << " Cancel: " << (*I)->DestFile << std::endl;
// the transaction will abort, so stop anything that is idle
if ((*I)->Status == pkgAcquire::Item::StatIdle)
+ {
(*I)->Status = pkgAcquire::Item::StatDone;
+ (*I)->Dequeue();
+ }
}
Transaction.clear();
}