diff options
| author | Karel Zak <kzak@redhat.com> | 2012-05-03 16:24:12 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2012-05-03 16:24:12 +0200 |
| commit | 1ea962b2088b8db2090917a5eb1609b5eb99e048 (patch) | |
| tree | cb2f30f7799e801c6271a3ab5da5cee7dfb14c3c /misc-utils/lsblk.c | |
| parent | 0bda832322dc426583477c05f640ca3acbbe8886 (diff) | |
| download | util-linux-1ea962b2088b8db2090917a5eb1609b5eb99e048.tar.gz | |
lsblk: fix /sys/.../ro usage
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.c')
| -rw-r--r-- | misc-utils/lsblk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index e3779ba0a4..9e894ef27e 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -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 */ |
