[LTP] [PATCH 1/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP

Petr Vorel
2025-12-08T15:06:33Z

errno EOPNOTSUPP is likely a configuration issue, skip testing
with TCONF.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
include/lapi/keyctl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index e08b8f1322..ab5c8a530f 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -209,10 +209,11 @@ static inline long safe_keyctl(const char *file, const int lineno,
{
long rval;
int failure = 0;
+ int res = errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO;

rval = keyctl(cmd, arg2, arg3, arg4, arg5);
if (rval == -1) {
- tst_brk_(file, lineno, TBROK | TERRNO,
+ tst_brk_(file, lineno, res,
"keyctl(%d, %lu, %lu, %lu, %lu)",
cmd, arg2, arg3, arg4, arg5);
}
--
2.51.0