From 33453ec69af1070dd5e15dd99c14ebb43c4e88c2 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Fri, 27 Dec 2019 21:30:21 +0200 Subject: posix-inode-fd-ops.c: fix a compiler warning - real_path may be NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following: posix-inode-fd-ops.c: In function ‘posix_common_removexattr’: ../../../../libglusterfs/src/glusterfs/logging.h:231:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 231 | _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, level, errnum, 0, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 232 | msgid, ##fmt); \ | ~~~~~~~~~~~~~ posix-inode-fd-ops.c:4401:13: note: in expansion of macro ‘gf_msg’ 4401 | gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_FDSTAT_FAILED, | ^~~~~~ posix-inode-fd-ops.c:4402:47: note: format string is defined here 4402 | "fdstat operaton failed on %s", real_path); | ^~ Change-Id: I3f2278d3a05a569dde257d66f44a8655491b4013 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/storage/posix/src/posix-inode-fd-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index bd1279cabb1..bbbc4e5b80f 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -4509,7 +4509,7 @@ posix_common_removexattr(call_frame_t *frame, loc_t *loc, fd_t *fd, ret = posix_fdstat(this, inode, _fd, &preop); if (ret) { gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_FDSTAT_FAILED, - "fdstat operaton failed on %s", real_path); + "fdstat operaton failed on %s", real_path ? real_path : ""); } } -- cgit