Skip to contentSkip to conversation

librdmacm/preload.c: Eliminate some compile warnings

PATCH In review Hal Rosenstock 2 participants 2 messages Jul 12, 2012 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 librdmacm/preload.c: Eliminate some compile warnings

by fixing a couple of typecasts

src/preload.c: In function ?bind?:
src/preload.c:350: warning: assignment from incompatible pointer type src/preload.c: In function ?connect?:
src/preload.c:397: warning: assignment from incompatible pointer type

---

src/preload.c +2 -2
index 8758d5c..2750b30 100644
@@ -347,7 +347,7 @@ int bind(int socket, const struct sockaddr *addr, socklen_t addrlen)
 	int fd, ret;
 
 	if (fd_get(socket, &fd) == fd_rsocket) {
-		sin = (struct sockaddr_sin *) addr;
+		sin = (struct sockaddr_in *) addr;
 		if (!sin->sin_port || ntohs(sin->sin_port) > 1024)
 			return rbind(fd, addr, addrlen);
 
@@ -394,7 +394,7 @@ int connect(int socket, const struct sockaddr *addr, socklen_t addrlen)
 	int fd, ret;
 
 	if (fd_get(socket, &fd) == fd_rsocket) {
-		sin = (struct sockaddr_sin *) addr;
+		sin = (struct sockaddr_in *) addr;
 		if (ntohs(sin->sin_port) > 1024) {
 			ret = rconnect(fd, addr, addrlen);
 			if (!ret || errno == EINPROGRESS)

--
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