X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mdstat.c;h=9a7327988e198bf5f74a9a5d4ed0ba7e11733485;hb=6fbba4c9295a1df735565d1cf0e376d15c2c2809;hp=3204d2e468f08d30e4f5753ef2e10115d365f121;hpb=dd0781e50555c32ff2f808ec46f4b03a5693ea47;p=thirdparty%2Fmdadm.git diff --git a/mdstat.c b/mdstat.c index 3204d2e4..9a732798 100644 --- 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' &&