]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
sysfs: Make sysfs_init() return an error code
[thirdparty/mdadm.git] / Monitor.c
index 2c0f717ce505c4572f21b9ca4d709cf9efba14e0..036a561c6f99684ec809c4da0fb0804296eba01f 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -1026,7 +1026,9 @@ int Wait(char *dev)
                         */
                        struct mdinfo mdi;
                        char buf[21];
-                       sysfs_init(&mdi, -1, devnm);
+
+                       if (sysfs_init(&mdi, -1, devnm))
+                               return 2;
                        if (sysfs_get_str(&mdi, NULL, "sync_action",
                                          buf, 20) > 0 &&
                            strcmp(buf,"idle\n") != 0) {