summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-07-27 11:12:51 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-28 03:34:44 -0700
commit0aae2c46579421b871919e93619273d9a9bc79fb (patch)
treec9b7405a80f509d5a5da2cf4882144cabf5b93c7 /rpc/rpc-transport
parentb2b6281e3487d3d797ab7974df69790a28c443c9 (diff)
fix all the clang errors in 'rpc/*'
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1133 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1133
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r--rpc/rpc-transport/socket/src/name.c18
-rw-r--r--rpc/rpc-transport/socket/src/socket.c11
2 files changed, 16 insertions, 13 deletions
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
index 763fa3dd0..e5b9199aa 100644
--- a/rpc/rpc-transport/socket/src/name.c
+++ b/rpc/rpc-transport/socket/src/name.c
@@ -605,21 +605,23 @@ int32_t
fill_inet6_inet_identifiers (rpc_transport_t *this, struct sockaddr_storage *addr,
int32_t addr_len, char *identifier)
{
- int32_t ret = 0, tmpaddr_len = 0;
- char service[NI_MAXSERV], host[NI_MAXHOST];
struct sockaddr_storage tmpaddr;
+ char service[NI_MAXSERV] = {0,};
+ char host[NI_MAXHOST] = {0,};
+ int32_t ret = 0;
+ int32_t tmpaddr_len = 0;
+ int32_t one_to_four = 0;
+ int32_t four_to_eight = 0;
+ int32_t twelve_to_sixteen = 0;
+ int16_t eight_to_ten = 0;
+ int16_t ten_to_twelve = 0;
+
memset (&tmpaddr, 0, sizeof (tmpaddr));
tmpaddr = *addr;
tmpaddr_len = addr_len;
if (((struct sockaddr *) &tmpaddr)->sa_family == AF_INET6) {
- int32_t one_to_four, four_to_eight, twelve_to_sixteen;
- int16_t eight_to_ten, ten_to_twelve;
-
- one_to_four = four_to_eight = twelve_to_sixteen = 0;
- eight_to_ten = ten_to_twelve = 0;
-
one_to_four = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr32[0];
four_to_eight = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr32[1];
#ifdef GF_SOLARIS_HOST_OS
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index b40a93ee8..6406d4589 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -392,12 +392,9 @@ __socket_reset (rpc_transport_t *this)
struct ioq *
__socket_ioq_new (rpc_transport_t *this, rpc_transport_msg_t *msg)
{
- socket_private_t *priv = NULL;
struct ioq *entry = NULL;
int count = 0;
- priv = this->private;
-
/* TODO: use mem-pool */
entry = GF_CALLOC (1, sizeof (*entry), gf_common_mt_ioq);
if (!entry)
@@ -1553,7 +1550,11 @@ socket_server_event_handler (int fd, int idx, void *data,
ret = -1;
}
pthread_mutex_unlock (&new_priv->lock);
- ret = rpc_transport_notify (this, RPC_TRANSPORT_ACCEPT, new_trans);
+ if (ret == -1)
+ goto unlock;
+
+ ret = rpc_transport_notify (this, RPC_TRANSPORT_ACCEPT,
+ new_trans);
}
}
unlock:
@@ -2112,7 +2113,7 @@ int32_t
socket_getmyaddr (rpc_transport_t *this, char *myaddr, int addrlen,
struct sockaddr *sa, socklen_t salen)
{
- int32_t ret = -1;
+ int32_t ret = 0;
if ((this == NULL) || (sa == NULL)) {
goto out;