diff mbox

[librdmacm] examples/r[io]stream.c: Better handling of rpoll errors during client async rconnect

Message ID 560BDE3E.9070806@dev.mellanox.co.il (mailing list archive)
State Accepted
Headers show

Commit Message

Hal Rosenstock Sept. 30, 2015, 1:06 p.m. UTC
Rather than silently exiting when connection is refused by server,
print error message (Connection refused) during async rconnect at client.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/examples/riostream.c b/examples/riostream.c
index c12dd0d..b6c9f86 100644
--- a/examples/riostream.c
+++ b/examples/riostream.c
@@ -470,8 +470,10 @@  static int client_connect(void)
 		fds.fd = rs;
 		fds.events = POLLOUT;
 		ret = do_poll(&fds, poll_timeout);
-		if (ret)
+		if (ret) {
+			perror("rpoll");
 			goto close;
+		}
 
 		len = sizeof err;
 		ret = rgetsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);
diff --git a/examples/rstream.c b/examples/rstream.c
index d93e9aa..4b76bbc 100644
--- a/examples/rstream.c
+++ b/examples/rstream.c
@@ -469,8 +469,10 @@  static int client_connect(void)
 		fds.fd = rs;
 		fds.events = POLLOUT;
 		ret = do_poll(&fds, poll_timeout);
-		if (ret)
+		if (ret) {
+			perror("rpoll");
 			goto close;
+		}
 
 		len = sizeof err;
 		ret = rs_getsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);