Skip to contentSkip to conversation

mount: Add missing cast to getsockname

PATCH In review Rosen Penev 2 participants 2 messages Apr 15, 2019 – Apr 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount: Add missing cast to getsockname

Otherwise compilation can fail with incompatible pointer type.

---
 utils/mount/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/mount/network.c +1 -1
index fc21110..e166a82 100644
@@ -1062,7 +1062,7 @@ int clnt_ping(struct sockaddr_in *saddr, const unsigned long prog,
 	if (caddr) {
 		/* Get the address of our end of this connection */
 		socklen_t len = sizeof(*caddr);
-		if (getsockname(sock, caddr, &len) != 0)
+		if (getsockname(sock, (struct sockaddr *) caddr, &len) != 0)
 			caddr->sin_family = 0;
 	}
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Rosen Penev

Otherwise compilation can fail with incompatible pointer type.

Committed....

steved.

Quoted 18 lines
---
 utils/mount/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/mount/network.c +1 -1
index fc21110..e166a82 100644
@@ -1062,7 +1062,7 @@ int clnt_ping(struct sockaddr_in *saddr, const unsigned long prog,
 	if (caddr) {
 		/* Get the address of our end of this connection */
 		socklen_t len = sizeof(*caddr);
-		if (getsockname(sock, caddr, &len) != 0)
+		if (getsockname(sock, (struct sockaddr *) caddr, &len) != 0)
 			caddr->sin_family = 0;
 	}