Patchwork [11/25] libe2p: reach unreachable code

login
register
mail settings
Submitter Eric Sandeen
Date Sept. 16, 2011, 8:49 p.m.
Message ID <1316206180-6375-12-git-send-email-sandeen@redhat.com>
Download mbox | patch
Permalink /patch/115050/
State Accepted
Headers show

Comments

Eric Sandeen - Sept. 16, 2011, 8:49 p.m.
The EOPNOTSUPP case is unreachable, being outside a set of:
 #if
	...
	return;
 #else
	...
	return;
 #endif

Fix this up so that if neither HAVE_CHFLAGS nor
HAVE_EXT2_IOCTLS applies, we set EOPNOTSUPP.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 lib/e2p/setflags.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Theodore Ts'o - Sept. 16, 2011, 10:54 p.m.
On Fri, Sep 16, 2011 at 03:49:26PM -0500, Eric Sandeen wrote:
> The EOPNOTSUPP case is unreachable, being outside a set of:
>  #if
> 	...
> 	return;
>  #else
> 	...
> 	return;
>  #endif
> 
> Fix this up so that if neither HAVE_CHFLAGS nor
> HAVE_EXT2_IOCTLS applies, we set EOPNOTSUPP.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/lib/e2p/setflags.c b/lib/e2p/setflags.c
index 72cf441..b203606 100644
--- a/lib/e2p/setflags.c
+++ b/lib/e2p/setflags.c
@@ -55,7 +55,7 @@  int setflags (int fd, unsigned long flags)
 #endif
 
 	return fchflags (fd, bsd_flags);
-#else
+#else /* ! HAVE_CHFLAGS */
 #if HAVE_EXT2_IOCTLS
 	struct stat buf;
 	int	f;
@@ -68,8 +68,9 @@  int setflags (int fd, unsigned long flags)
 	f = (int) flags;
 
 	return ioctl(fd, EXT2_IOC_SETFLAGS, &f);
-#endif /* HAVE_EXT2_IOCTLS */
-#endif
+#else
 	errno = EOPNOTSUPP;
 	return -1;
+#endif /* HAVE_EXT2_IOCTLS */
+#endif /* HAVE_CHFLAGS */
 }