summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-08 23:37:46 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 09:15:33 -0700
commita7a2b8218958579006778b1200a0e40125291e0f (patch)
tree61218fc536f77f8d68afa12874b5b47fee208397 /xlators/nfs
parente719518e561033af0ffd07d0c8ad7d777715fe89 (diff)
build warning fixes
mainly fixes all the sockaddr related 'strict aliasing' warnings Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2550 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/lib/src/rpc-socket.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/nfs/lib/src/rpc-socket.c b/xlators/nfs/lib/src/rpc-socket.c
index 3d18a3c48..d2b4bfeb2 100644
--- a/xlators/nfs/lib/src/rpc-socket.c
+++ b/xlators/nfs/lib/src/rpc-socket.c
@@ -83,21 +83,21 @@ int
nfs_rpcsvc_socket_listen (int addrfam, char *listenhost, uint16_t listenport)
{
int sock = -1;
- struct sockaddr_storage sockaddr;
socklen_t sockaddr_len;
int flags = 0;
int ret = -1;
int opt = 1;
+ union gf_sock_union sock_union;
ret = nfs_rpcsvc_socket_server_get_local_socket (addrfam, listenhost,
listenport,
- SA (&sockaddr),
+ &sock_union.sa,
&sockaddr_len);
if (ret == -1)
return ret;
- sock = socket (SA (&sockaddr)->sa_family, SOCK_STREAM, 0);
+ sock = socket (sock_union.sa.sa_family, SOCK_STREAM, 0);
if (sock == -1) {
gf_log (GF_RPCSVC_SOCK, GF_LOG_ERROR, "socket creation failed"
" (%s)", strerror (errno));
@@ -125,7 +125,7 @@ nfs_rpcsvc_socket_listen (int addrfam, char *listenhost, uint16_t listenport)
goto close_err;
}
- ret = bind (sock, (struct sockaddr *)&sockaddr, sockaddr_len);
+ ret = bind (sock, &sock_union.sa, sockaddr_len);
if (ret == -1) {
if (errno != EADDRINUSE) {
gf_log (GF_RPCSVC_SOCK, GF_LOG_ERROR, "binding socket "