fd-util: accept that kcmp might fail with EPERM/EACCES

In a container the kcmp call might well be blocked; Accept that and fall
back to fstat in that case.
This commit is contained in:
Sjoerd Simons 2018-08-28 09:32:18 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent c68867da32
commit 9e2acd1d24

View file

@ -277,7 +277,7 @@ int same_fd(int a, int b) {
return true; return true;
if (r > 0) if (r > 0)
return false; return false;
if (errno != ENOSYS) if (!IN_SET(errno, ENOSYS, EACCES, EPERM))
return -errno; return -errno;
/* We don't have kcmp(), use fstat() instead. */ /* We don't have kcmp(), use fstat() instead. */