lsblk: fix /sys/.../ro usage

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-05-03 16:24:12 +02:00
parent 0bda832322
commit 1ea962b208
1 changed files with 1 additions and 1 deletions

View 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 */