summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 2c89c2dea..07c4646f5 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -152,6 +152,8 @@ bool pkgAcquire::GetLock(std::string const &Lock)
return true;
// Lock the directory this acquire object will work in
+ if (LockFD != -1)
+ close(LockFD);
LockFD = ::GetLock(flCombine(Lock, "lock"));
if (LockFD == -1)
return _error->Error(_("Unable to lock directory %s"), Lock.c_str());