]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdstat.c
mdadm-1.7.0
[thirdparty/mdadm.git] / mdstat.c
index 3204d2e468f08d30e4f5753ef2e10115d365f121..9a7327988e198bf5f74a9a5d4ed0ba7e11733485 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -153,6 +153,7 @@ struct mdstat_ent *mdstat_read(int hold)
                ent->next = NULL;
                ent->percent = -1;
                ent->active = -1;
+               ent->resync = 0;
 
                ent->dev = strdup(line);
                ent->devnum = devnum;
@@ -179,6 +180,11 @@ struct mdstat_ent *mdstat_read(int hold)
                                   w[l-1] == '%' &&
                                   (eq=strchr(w, '=')) != NULL ) {
                                ent->percent = atoi(eq+1);
+                               if (strncmp(w,"resync", 4)==0)
+                                       ent->resync = 1;
+                       } else if (ent->percent == -1 &&
+                                  strncmp(w, "resync", 4)==0) {
+                               ent->resync = 1;
                        } else if (ent->percent == -1 &&
                                   w[0] >= '0' && 
                                   w[0] <= '9' &&