diff options
author | Amar Tumballi <amar@gluster.com> | 2009-07-17 22:44:11 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-07-20 14:29:15 -0700 |
commit | 500d114032c0d6f92abd25fbf6786b866a0b3dd5 (patch) | |
tree | 6e6d582111e39a9e2847b93d20269287ea3c8545 /xlators | |
parent | 0af7bd9a1f590a17490663869420bd8777189b97 (diff) |
fix build warnings in 'afr'
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 130 (build warnings)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 10 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 14 |
2 files changed, 18 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index a5e698cd2cb..80608dbd262 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -351,9 +351,15 @@ build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name) } if (strcmp (parent->path, "/") == 0) - asprintf ((char **)&child->path, "/%s", name); + ret = asprintf ((char **)&child->path, "/%s", name); else - asprintf ((char **)&child->path, "%s/%s", parent->path, name); + ret = asprintf ((char **)&child->path, "%s/%s", parent->path, + name); + + if (-1 == ret) { + gf_log (this->name, GF_LOG_ERROR, + "asprintf failed while setting child path"); + } if (!child->path) { gf_log (this->name, GF_LOG_ERROR, diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 33aa1615789..11aba41db14 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -2420,8 +2420,8 @@ init (xlator_t *this) lock_server_count); if (lock_server_count == 0) - gf_log (this->name, GF_LOG_WARNING, - no_lock_servers_warning_str); + gf_log (this->name, GF_LOG_WARNING, "%s", + no_lock_servers_warning_str); priv->data_lock_server_count = lock_server_count; } @@ -2505,8 +2505,14 @@ init (xlator_t *this) while (i < child_count) { priv->children[i] = trav->xlator; - asprintf (&priv->pending_key[i], "%s.%s", AFR_XATTR_PREFIX, - trav->xlator->name); + ret = asprintf (&priv->pending_key[i], "%s.%s", AFR_XATTR_PREFIX, + trav->xlator->name); + if (-1 == ret) { + gf_log (this->name, GF_LOG_ERROR, + "asprintf failed to set pending key"); + op_errno = ENOMEM; + goto out; + } trav = trav->next; i++; |