summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-12-23 17:48:16 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-12-23 17:48:16 +0100
commit8d968cc2d1e11da81f3bab878c1a413a97ca27ed (patch)
tree33c558f0a730625e15cca4d234207e7fc7cda465 /apt-private
parentb3db9d81325769fb9d9c6518f9d917f90328bef1 (diff)
downloadapt-8d968cc2d1e11da81f3bab878c1a413a97ca27ed.tar.gz
ensure we got a lock in clean operation
We try to acquired the locks, but we didn't stop if we failed to get it… Closes: 808561
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-download.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index 5cdcf6038..6f672635f 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -309,16 +309,16 @@ bool DoClean(CommandLine &)
}
pkgAcquire Fetcher;
- if (archivedir.empty() == false && FileExists(archivedir) == true)
+ if (archivedir.empty() == false && FileExists(archivedir) == true &&
+ Fetcher.GetLock(archivedir) == true)
{
- Fetcher.GetLock(archivedir);
Fetcher.Clean(archivedir);
Fetcher.Clean(archivedir + "partial/");
}
- if (listsdir.empty() == false && FileExists(listsdir) == true)
+ if (listsdir.empty() == false && FileExists(listsdir) == true &&
+ Fetcher.GetLock(listsdir) == true)
{
- Fetcher.GetLock(listsdir);
Fetcher.Clean(listsdir + "partial/");
}