From 6e41b17d855cf680efb93414083cf1490007d3ce Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 21 Jul 2017 12:06:20 +0200 Subject: glusterd: fix compile warning in glusterd_volinfo_copy_brickinfo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc 7 (default in Fedora 26) complains about the following: glusterd-utils.c: In function ‘glusterd_volinfo_copy_brickinfo’: glusterd-utils.c:4279:54: warning: comparison between pointer and zero character constant [-Wpointer-compare] if (old_brickinfo->real_path == '\0') { ^~ glusterd-utils.c:4279:29: note: did you mean to dereference the pointer? if (old_brickinfo->real_path == '\0') { ^ Comparing a char* with a char is not correct in any case. Instead, compare it to NULL and the char[0] with '\0'. Change-Id: Ie5b925cd200416a1e2fa035046005f421994e641 Updates: #259 Signed-off-by: Niels de Vos Reviewed-on: https://review.gluster.org/17847 Tested-by: Atin Mukherjee Reviewed-by: Prashanth Pai Smoke: Gluster Build System Reviewed-by: Samikshan Bairagya CentOS-regression: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f1627df688f..fe1d16865ef 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4304,7 +4304,7 @@ glusterd_volinfo_copy_brickinfo (glusterd_volinfo_t *old_volinfo, if (ret == 0) { new_brickinfo->port = old_brickinfo->port; - if (old_brickinfo->real_path == '\0') { + if (old_brickinfo->real_path[0] == '\0') { if (!realpath (new_brickinfo->path, abspath)) { /* Here an ENOENT should also be a * failure as the brick is expected to -- cgit