summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2020-03-06 12:57:38 +0000
committerJulian Andres Klode <jak@debian.org>2020-03-06 12:57:38 +0000
commit44d8409b9c8399577d7652649862be2591b1ff64 (patch)
treecf511b030725b1a7bb97f3c402ff5df773b84382 /apt-pkg/contrib/fileutl.cc
parent9f36e3cf3fe158fd52c662b5c8c6f6cab327fa06 (diff)
parent1b81f6bd13bb31e59da3f53cfdc7caab43abf887 (diff)
Merge branch 'pu/improve-locking-msgs' into 'master'
Pu/improve locking msgs See merge request apt-team/apt!111
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index db5463be2..045dbe17d 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -302,13 +302,15 @@ int GetLock(string File,bool Errors)
if (Errors == true)
{
+ // We only do the lookup in the if ((errno == EACCES || errno == EAGAIN))
+ // case, so we do not need to show the errno strerrr here...
if (fl.l_pid != -1)
{
auto name = GetProcessName(fl.l_pid);
if (name.empty())
- _error->Errno("open", _("Could not get lock %s. It is held by process %d"), File.c_str(), fl.l_pid);
+ _error->Error(_("Could not get lock %s. It is held by process %d"), File.c_str(), fl.l_pid);
else
- _error->Errno("open", _("Could not get lock %s. It is held by process %d (%s)"), File.c_str(), fl.l_pid, name.c_str());
+ _error->Error(_("Could not get lock %s. It is held by process %d (%s)"), File.c_str(), fl.l_pid, name.c_str());
}
else
_error->Errno("open", _("Could not get lock %s"), File.c_str());