diff options
author | Guillem Jover <guillem@debian.org> | 2015-12-30 02:19:32 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-01-26 13:34:02 +0100 |
commit | 742cb8c4fd0990867dd437cf52dd86ccabdf5f05 (patch) | |
tree | da2b3c61106ba8b6097ac6b6d19d5d67dd987e34 /dselect/method.cc | |
parent | c399906c2d576d523deacccd60d6072864279874 (diff) | |
download | dpkg-742cb8c4fd0990867dd437cf52dd86ccabdf5f05.tar.gz |
dselect: Use EACCES instead of EWOULDBLOCK for fcntl(2) F_SETLK
This fcntl(2) sub-command returns either EACCES or EAGAIN on error.
Warned-by: gcc-6
Diffstat (limited to 'dselect/method.cc')
-rw-r--r-- | dselect/method.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dselect/method.cc b/dselect/method.cc index cdafd12f1..2d1ebc59e 100644 --- a/dselect/method.cc +++ b/dselect/method.cc @@ -120,10 +120,10 @@ static enum urqresult lockmethod(void) { } fl.l_type=F_WRLCK; fl.l_whence=SEEK_SET; fl.l_start=fl.l_len=0; if (fcntl(methlockfd,F_SETLK,&fl) == -1) { - if (errno == EWOULDBLOCK || errno == EAGAIN) { + if (errno == EACCES || errno == EAGAIN) { sthfailed(_("the access method area is already locked")); return urqr_fail; - } + } sthfailed(_("cannot lock access method area")); return urqr_fail; } |