mirror of
https://github.com/openharmony/third_party_liburing.git
synced 2026-07-21 07:05:34 -04:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user