]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
udpong: Fix client_recv error check
authorSean Hefty <sean.hefty@intel.com>
Wed, 23 Jul 2014 06:24:53 +0000 (23:24 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 23 Jul 2014 06:24:53 +0000 (23:24 -0700)
We only want to report an error if it's not EGAIN.  The if
statement is reversed.  Correct it.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
examples/udpong.c

index af8deb9ee8b21c4a8a75169d7d273c1d267ad4c9..7ec11e85ae50b8082d529dc016082cfe6558d680 100644 (file)
@@ -347,7 +347,7 @@ static ssize_t client_recv(struct message *msg, size_t size, int timeout)
        }
 
        ret = rs_recv(rs, msg, size, flags | MSG_DONTWAIT);
-       if (ret < 0 && (errno == EWOULDBLOCK || errno == EAGAIN))
+       if (ret < 0 && errno != EWOULDBLOCK && errno != EAGAIN)
                perror("rrecv");
 
        return ret;