[PATCH 3/5] rpcbind: Squelch a compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove a needless pointer-to-integer conversion.  getnameinfo(3) wants
a size value greater than or equal to offsetof(struct sockaddr_un,
sun_path).  Since pointers can be different sizes depending on the
hardware platform, let's make this a simple constant instead.

This eliminates the compiler warning:

rpcinfo.c: In function ‘sa_len’:
rpcinfo.c:666: warning: cast from pointer to integer of different size

when building on x86-64.

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---

 src/rpcinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/rpcinfo.c b/src/rpcinfo.c
index afd949b..0170f65 100644
--- a/src/rpcinfo.c
+++ b/src/rpcinfo.c
@@ -663,7 +663,7 @@ sa_len(struct sockaddr *sa)
     switch (sa->sa_family)
     {
         case AF_LOCAL:
-            salen = (socklen_t) (((struct sockaddr_un *) NULL)->sun_path);
+            salen = sizeof (struct sockaddr_un);
             break;
         case AF_INET:
             salen = sizeof (struct sockaddr_in);

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux