mount: Add missing cast to getsockname
diff mbox series

Message ID 20190415020838.924-1-rosenp@gmail.com
State New
Headers show
Series
  • mount: Add missing cast to getsockname
Related show

Commit Message

Rosen Penev April 15, 2019, 2:08 a.m. UTC
Otherwise compilation can fail with incompatible pointer type.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/mount/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Dickson April 16, 2019, 6:28 p.m. UTC | #1
On 4/14/19 10:08 PM, Rosen Penev wrote:
> Otherwise compilation can fail with incompatible pointer type.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Committed.... 

steved.

> ---
>  utils/mount/network.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index fc21110..e166a82 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -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;
>  	}
>  
>

Patch
diff mbox series

diff --git a/utils/mount/network.c b/utils/mount/network.c
index fc21110..e166a82 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -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;
 	}