]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: fix /sys/.../ro usage
authorKarel Zak <kzak@redhat.com>
Thu, 3 May 2012 14:24:12 +0000 (16:24 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 3 May 2012 14:24:12 +0000 (16:24 +0200)
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index e3779ba0a492d058317a10641690b65b6ba5252f..9e894ef27e26209df4f4dde4ff2406bf0fef0557 100644 (file)
@@ -442,7 +442,7 @@ static int is_readonly_device(struct blkdev_cxt *cxt)
 {
        int fd, ro = 0;
 
-       if (sysfs_scanf(&cxt->sysfs, "ro", "%d", &ro) == 0)
+       if (sysfs_scanf(&cxt->sysfs, "ro", "%d", &ro) == 1)
                return ro;
 
        /* fallback if "ro" attribute does not exist */