If no pending connections are present for the rsocket
marked as nonblocknig, raccept should fail with the error
EAGAIN or EWOULDBLOCK.
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
param.private_data = &cresp;
param.private_data_len = sizeof cresp;
ret = rdma_accept(new_rs->cm_id, ¶m);
- if (!ret)
+ if (!ret) {
new_rs->state = rs_connect_rdwr;
- else if (errno == EAGAIN || errno == EWOULDBLOCK)
+ } else if (errno == EAGAIN || errno == EWOULDBLOCK) {
new_rs->state = rs_accepting;
- else
+ return 1;
+ } else {
goto err;
+ }
if (addr && addrlen)
rgetpeername(new_rs->index, addr, addrlen);