diff options
| author | Anoop C S <anoopcs@redhat.com> | 2017-07-27 14:15:22 +0530 | 
|---|---|---|
| committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-08-09 12:58:07 +0000 | 
| commit | 071559cb4745669c87198128ab73d7af2017e9bd (patch) | |
| tree | d825b74373bafcfb021778ed9b241903babc660d | |
| parent | 747a08d34e2a1e94d7fce68a3577370288bb1955 (diff) | |
contrib/fuse-lib: Fix compiler warning within switch case
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 <anoopcs@redhat.com>
Reviewed-on: https://review.gluster.org/17878
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
| -rw-r--r-- | contrib/fuse-lib/mount.c | 4 | 
1 files changed, 3 insertions, 1 deletions
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;  | 
