util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lib: [loopdev.c] fix use of logical '&&' with constant operand
@ 2011-09-15 14:17 Francesco Cosoleto
  2011-09-15 14:17 ` [PATCH 2/2] libmount: " Francesco Cosoleto
  2011-09-27 13:07 ` [PATCH 1/2] lib: [loopdev.c] " Karel Zak
  0 siblings, 2 replies; 4+ messages in thread
From: Francesco Cosoleto @ 2011-09-15 14:17 UTC (permalink / raw)
  To: util-linux; +Cc: Francesco Cosoleto

Found by clang.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 lib/loopdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/loopdev.c b/lib/loopdev.c
index 81b7d2d..7c095ee 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -116,7 +116,7 @@ int loopcxt_init(struct loopdev_cxt *lc, int flags)
 	lc->flags = flags;
 	loopcxt_set_device(lc, NULL);
 
-	if (!(lc->flags && LOOPDEV_FL_NOSYSFS) &&
+	if (!(lc->flags & LOOPDEV_FL_NOSYSFS) &&
 	    get_linux_version() >= KERNEL_VERSION(2,6,37))
 		/*
 		 * Use only sysfs for basic information about loop devices
@@ -244,7 +244,7 @@ int loopcxt_init_iterator(struct loopdev_cxt *lc, int flags)
 		/*
 		 * Check for /dev/loop/<N> subdirectory
 		 */
-		if (!(lc->flags && LOOPDEV_FL_DEVSUBDIR) &&
+		if (!(lc->flags & LOOPDEV_FL_DEVSUBDIR) &&
 		    stat(_PATH_DEV_LOOP, &st) == 0 && S_ISDIR(st.st_mode))
 			lc->flags |= LOOPDEV_FL_DEVSUBDIR;
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-27 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 14:17 [PATCH 1/2] lib: [loopdev.c] fix use of logical '&&' with constant operand Francesco Cosoleto
2011-09-15 14:17 ` [PATCH 2/2] libmount: " Francesco Cosoleto
2011-09-27 13:07   ` Karel Zak
2011-09-27 13:07 ` [PATCH 1/2] lib: [loopdev.c] " Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).