[LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL()

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

Using SAFE_KEYCTL() helps to TCONF on EOPNOTSUPP, which is a
configuration issue.

Reported-by: Meng Yang <yangm50@chinatelecom.cn>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/watchqueue/common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/watchqueue/common.h b/testcases/kernel/watchqueue/common.h
index 92e8f079cd..0921dce9a6 100644
--- a/testcases/kernel/watchqueue/common.h
+++ b/testcases/kernel/watchqueue/common.h
@@ -85,8 +85,8 @@ static inline key_serial_t wqueue_add_key(int fd)
if (key == -1)
tst_brk(TBROK, "add_key error: %s", tst_strerrno(errno));

- keyctl(KEYCTL_WATCH_KEY, key, fd, 0x01);
- keyctl(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02);
+ SAFE_KEYCTL(KEYCTL_WATCH_KEY, key, fd, 0x01, 0);
+ SAFE_KEYCTL(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02, 0);

return key;
}
--
2.51.0