While waiting for a completion event, rsocket state is incorrectly
authorSreedhar Kodali <srkodali@linux.vnet.ibm.com>
Thu, 18 Sep 2014 09:05:42 +0000 (14:35 +0530)
committerSean Hefty <sean.hefty@intel.com>
Mon, 29 Sep 2014 19:47:03 +0000 (12:47 -0700)
set to error when interrupted.  Instead, the caller of get
completion event should decide what to do with it based on
errno.  The fix is do not change the state to rs_error when
errno is EINTR inside get completion event.

Signed-off-by: Sreedhar Kodali <srkodali@linux.vnet.ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/rsocket.c

index ba188a5..074fb18 100644 (file)
@@ -1978,7 +1978,7 @@ static int rs_get_cq_event(struct rsocket *rs)
                        rs->unack_cqe = 0;
                }
                rs->cq_armed = 0;
-       } else if (errno != EAGAIN) {
+       } else if (!(errno == EAGAIN || errno == EINTR)) {
                rs->state = rs_error;
        }