diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-16 09:40:06 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-17 11:57:51 -0700 |
commit | e02171f1b86cfb3cd365c4c47edc83b8230985bd (patch) | |
tree | 7e7bf4a32153b4c1e512e0e6f9ea1e28958c0532 /rpc/rpc-transport/socket/src/name.c | |
parent | 02d8dcbb5c7483ade3dd052d75e6430cb0253d1f (diff) |
rpc-transport: log enhancement
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2346 (Log message enhancements in GlusterFS - phase 1)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'rpc/rpc-transport/socket/src/name.c')
-rw-r--r-- | rpc/rpc-transport/socket/src/name.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c index 740f457845e..9cda665fec3 100644 --- a/rpc/rpc-transport/socket/src/name.c +++ b/rpc/rpc-transport/socket/src/name.c @@ -126,6 +126,8 @@ client_fill_address_family (rpc_transport_t *this, sa_family_t *sa_family) int32_t ret = -1; if (sa_family == NULL) { + gf_log_callingfn ("", GF_LOG_WARNING, + "sa_family argument is NULL"); goto out; } @@ -469,12 +471,9 @@ socket_client_get_remote_sockaddr (rpc_transport_t *this, { int32_t ret = 0; - if ((sockaddr == NULL) || (sockaddr_len == NULL) - || (sa_family == NULL)) { - ret = -1; - goto err; - } - + GF_VALIDATE_OR_GOTO ("socket", sockaddr, err); + GF_VALIDATE_OR_GOTO ("socket", sockaddr_len, err); + GF_VALIDATE_OR_GOTO ("socket", sa_family, err); ret = client_fill_address_family (this, &sockaddr->sa_family); if (ret) { @@ -522,9 +521,7 @@ server_fill_address_family (rpc_transport_t *this, sa_family_t *sa_family) data_t *address_family_data = NULL; int32_t ret = -1; - if (sa_family == NULL) { - goto out; - } + GF_VALIDATE_OR_GOTO ("socket", sa_family, out); address_family_data = dict_get (this->options, "transport.address-family"); @@ -566,9 +563,9 @@ socket_server_get_local_sockaddr (rpc_transport_t *this, struct sockaddr *addr, { int32_t ret = -1; - if ((addr == NULL) || (addr_len == NULL) || (sa_family == NULL)) { - goto err; - } + GF_VALIDATE_OR_GOTO ("socket", sa_family, err); + GF_VALIDATE_OR_GOTO ("socket", addr, err); + GF_VALIDATE_OR_GOTO ("socket", addr_len, err); ret = server_fill_address_family (this, &addr->sa_family); if (ret == -1) { |