From 9e2acd1d24a8516c94ce862e9fbf63dd8d751572 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Tue, 28 Aug 2018 09:32:18 +0200 Subject: [PATCH] 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. --- src/basic/fd-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index e085dc23b4..b97bd191ab 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -277,7 +277,7 @@ int same_fd(int a, int b) { return true; if (r > 0) return false; - if (errno != ENOSYS) + if (!IN_SET(errno, ENOSYS, EACCES, EPERM)) return -errno; /* We don't have kcmp(), use fstat() instead. */