summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorJes Sorensen <jsorensen@fb.com>2017-04-25 20:34:31 +0200
committerJes Sorensen <jsorensen@fb.com>2017-04-25 20:34:31 +0200
commit0885b942b3575c7f2a8290087751d83902587371 (patch)
tree2b3da4898ef145a44e7f71f5017e84de539c30ed /Detail.c
parentDetail: Respect code lines are 80 character wide (diff)
downloadmdadm-0885b942b3575c7f2a8290087751d83902587371.tar.xz
mdadm-0885b942b3575c7f2a8290087751d83902587371.zip
Detail: Reinstate support for not having sysfs
While sysfs support will hopefully go away eventually, lets not break it unnecessarily for now. Fixes: 901d5ee ("Detail: Stop bothering about md drivers older than 0.90.00") Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Detail.c b/Detail.c
index ceb21b15..ef2370ce 100644
--- a/Detail.c
+++ b/Detail.c
@@ -88,9 +88,11 @@ int Detail(char *dev, struct context *c)
}
sra = sysfs_read(fd, NULL, GET_VERSION | GET_DEVS | GET_ARRAY_STATE);
if (!sra) {
- pr_err("%s does not appear to be an md device\n", dev);
- close(fd);
- return rv;
+ if (md_get_array_info(fd, &array)) {
+ pr_err("%s does not appear to be an md device\n", dev);
+ close(fd);
+ return rv;
+ }
}
external = (sra != NULL && sra->array.major_version == -1 &&
sra->array.minor_version == -2);