diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-07-21 12:06:20 +0200 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-07-25 21:14:04 +0000 |
commit | 6e41b17d855cf680efb93414083cf1490007d3ce (patch) | |
tree | ecb4ab0978eaa7c950dfa2bd3ee4970cfd70c77f /xlators/mgmt | |
parent | eb266ade1e2da5739ed66495755ec2784a5bf74b (diff) |
glusterd: fix compile warning in glusterd_volinfo_copy_brickinfo()
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 <ndevos@redhat.com>
Reviewed-on: https://review.gluster.org/17847
Tested-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 |