test/sigfd-deadlock: skip test if poll returns -EOPNOTSUPP

Some kernels may disable IORING_OP_POLL support for signalfd and Binder
file descriptors via the Stable commit fc78b2fc21f1
("io_uring: disable polling pollfree files"). Skip the test for this
case.

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2022-09-27 15:23:56 +02:00
parent 4d05e19aa0
commit 6bbdd59b88
+5 -2
View File
@@ -50,7 +50,10 @@ static int test_uring(int sfd)
kill(getpid(), SIGINT);
io_uring_wait_cqe(&ring, &cqe);
if (cqe->res < 0) {
if (cqe->res == -EOPNOTSUPP) {
fprintf(stderr, "signalfd poll not supported\n");
ret = T_EXIT_SKIP;
} else if (cqe->res < 0) {
fprintf(stderr, "poll failed: %d\n", cqe->res);
ret = T_EXIT_FAIL;
} else if (cqe->res & POLLIN) {
@@ -77,7 +80,7 @@ int main(int argc, char *argv[])
return T_EXIT_FAIL;
ret = test_uring(sfd);
if (ret)
if (ret == T_EXIT_FAIL)
fprintf(stderr, "test_uring signalfd failed\n");
close(sfd);