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:
parent
0bda832322
commit
1ea962b208
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue