From 500d114032c0d6f92abd25fbf6786b866a0b3dd5 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 17 Jul 2009 22:44:11 +0000 Subject: fix build warnings in 'afr' Signed-off-by: Anand V. Avati BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130 --- xlators/cluster/afr/src/afr-self-heal-entry.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index a5e698cd2..80608dbd2 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, -- cgit