diff options
author | Michael Vogt <mvo@debian.org> | 2013-07-28 09:25:57 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-07-28 09:25:57 +0200 |
commit | 0c33605d981ceb78a4761e39043dc79ef9a571b2 (patch) | |
tree | 83fa22dda53f0abccd7b9cf7376af8553c559068 /cmdline/apt-get.cc | |
parent | 402c0d19a0c6668d7710b2b48561eb3059a04584 (diff) | |
parent | 163dc55bd6891008adcdf6d683a94e890a00f8c7 (diff) |
Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sid
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 85ed80a95..73b396795 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2290,9 +2290,10 @@ bool DoClean(CommandLine &CmdL) FileFd Lock; if (_config->FindB("Debug::NoLocking",false) == false) { - Lock.Fd(GetLock(archivedir + "lock")); - if (_error->PendingError() == true) + int lock_fd = GetLock(archivedir + "lock"); + if (lock_fd < 0) return _error->Error(_("Unable to lock the download directory")); + Lock.Fd(lock_fd); } pkgAcquire Fetcher; @@ -2326,9 +2327,10 @@ bool DoAutoClean(CommandLine &CmdL) FileFd Lock; if (_config->FindB("Debug::NoLocking",false) == false) { - Lock.Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock")); - if (_error->PendingError() == true) + int lock_fd = GetLock(_config->FindDir("Dir::Cache::Archives") + "lock"); + if (lock_fd < 0) return _error->Error(_("Unable to lock the download directory")); + Lock.Fd(lock_fd); } CacheFile Cache; |