From 071559cb4745669c87198128ab73d7af2017e9bd Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Thu, 27 Jul 2017 14:15:22 +0530 Subject: contrib/fuse-lib: Fix compiler warning within switch case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following warning is shown when compiled with gcc v7: mount.c: In function ‘gf_fuse_unmount_daemon’: mount.c:98:22: warning: statement will never be executed [-Wswitch-unreachable] char c = 0; ^ CCLD fuse.la We just need to move the relevant declaration statements to that switch case where it is valid and is being used. Change-Id: I8e50cc7cfcfc3bc88218cd69abbf516c08ee1648 Updates: #259 Signed-off-by: Anoop C S Reviewed-on: https://review.gluster.org/17878 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- contrib/fuse-lib/mount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c index 05d04b769e5..6801f9d7383 100644 --- a/contrib/fuse-lib/mount.c +++ b/contrib/fuse-lib/mount.c @@ -95,9 +95,10 @@ gf_fuse_unmount_daemon (const char *mountpoint, int fd) pid = fork (); switch (pid) { + case 0: + { char c = 0; sigset_t sigset; - case 0: close_fds_except (ump, 1); @@ -110,6 +111,7 @@ gf_fuse_unmount_daemon (const char *mountpoint, int fd) gf_fuse_unmount (mountpoint, fd); exit (0); + } case -1: close (fd); fd = -1; -- cgit