]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib,loopdev: fix use of logical '&&' with constant operand
authorFrancesco Cosoleto <cosoleto@gmail.com>
Thu, 15 Sep 2011 14:17:45 +0000 (16:17 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Oct 2011 12:22:27 +0000 (14:22 +0200)
Found by clang.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
lib/loopdev.c

index de227e2265e15f4d164d08cbccb41134cea00bc9..5a60b106b9509f6b8a56cb696942d7b9e4dcb91a 100644 (file)
@@ -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;