From 1ea962b2088b8db2090917a5eb1609b5eb99e048 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 3 May 2012 16:24:12 +0200 Subject: [PATCH] lsblk: fix /sys/.../ro usage Reported-by: Milan Broz Signed-off-by: Karel Zak --- misc-utils/lsblk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.47.3