From 353403824b5112c254f6788bad5edbbb19b96683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Wed, 21 Oct 2020 20:22:01 +0200 Subject: [PATCH] libdasd: Fix dasd_get_host_access_count() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit 75e3afb6a0c7 ("libdasd: Move get_host_access_count() to libdasd") dasd_get_host_access_count() reports always 0 as the check for unsuccessful execution of util_sys_get_dev_addr() is incorrect. Fix the behaviour by turning the check around. Fixes: 75e3afb6a0c7 ("libdasd: Move get_host_access_count() to libdasd") Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- libdasd/dasd_sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdasd/dasd_sys.c b/libdasd/dasd_sys.c index da30ef6f..dac2ab5c 100644 --- a/libdasd/dasd_sys.c +++ b/libdasd/dasd_sys.c @@ -214,7 +214,7 @@ int dasd_get_host_access_count(char *device) char *path; long value; - if (!util_sys_get_dev_addr(device, busid)) + if (util_sys_get_dev_addr(device, busid) != 0) return 0; path = util_path_sysfs("bus/ccw/devices/%s/host_access_count", busid);