summaryrefslogtreecommitdiff
path: root/test/io-cancel.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/io-cancel.c')
-rw-r--r--test/io-cancel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/io-cancel.c b/test/io-cancel.c
index b5b443d..703ffa7 100644
--- a/test/io-cancel.c
+++ b/test/io-cancel.c
@@ -341,8 +341,21 @@ static int test_cancel_req_across_fork(void)
fprintf(stderr, "wait_cqe=%d\n", ret);
return 1;
}
- if ((cqe->user_data == 1 && cqe->res != -EINTR) ||
- (cqe->user_data == 2 && cqe->res != -EALREADY && cqe->res)) {
+ switch (cqe->user_data) {
+ case 1:
+ if (cqe->res != -EINTR &&
+ cqe->res != -ECANCELED) {
+ fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
+ exit(1);
+ }
+ break;
+ case 2:
+ if (cqe->res != -EALREADY && cqe->res) {
+ fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
+ exit(1);
+ }
+ break;
+ default:
fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
exit(1);
}