From ea8cf4b17fb06612d7de8a6fc84d7a76deb9cfbd Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Mon, 16 May 2022 15:12:16 +0200 Subject: [PATCH] examples: fix wait_and_process_completions() in example 08 rpma_cq_get_wc() should not return RPMA_E_NO_COMPLETION when it is run in the current loop. --- .../08-messages-ping-pong/messages-ping-pong-common.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/08-messages-ping-pong/messages-ping-pong-common.c b/examples/08-messages-ping-pong/messages-ping-pong-common.c index 23dc5ea5b6..3bf2a70aa7 100644 --- a/examples/08-messages-ping-pong/messages-ping-pong-common.c +++ b/examples/08-messages-ping-pong/messages-ping-pong-common.c @@ -56,13 +56,8 @@ wait_and_process_completions(struct rpma_cq *cq, uint64_t *recv, return ret; /* get two next completions at most (1 of send + 1 of recv) */ - if ((ret = rpma_cq_get_wc(cq, MAX_N_WC, wc, &num_got))) { - /* lack of completions is not an error here */ - if (ret == RPMA_E_NO_COMPLETION) - continue; - if (ret) - return ret; - } + if ((ret = rpma_cq_get_wc(cq, MAX_N_WC, wc, &num_got))) + return ret; /* validate received completions */ for (int i = 0; i < num_got; i++) {