Skip to contentSkip to conversation

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

PATCH New Hal Rosenstock 1 participant 1 message Sep 30, 2015 InfiniBand

lore
Share & tools
lore
#0 lore raw

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

Rather than silently exiting when connection is refused by server, print error message (Connection refused) during async rconnect at client.

---

examples/riostream.c +3 -1
index c12dd0d..b6c9f86 100644
@@ -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);
examples/rstream.c +3 -1
index d93e9aa..4b76bbc 100644
@@ -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);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html