]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdstat.c
imsm: fix up assembly of disks that are not in-sync
[thirdparty/mdadm.git] / mdstat.c
index a65e7c3ab49b2362aa5a961feecaeec2ecfcf046..4bb29d85c822237e1a0244ff477561f125e0e5c5 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -191,11 +191,7 @@ struct mdstat_ent *mdstat_read(int hold, int start)
                                         * there.
                                         */
                                        struct mdstat_ent **ih;
-                                       int dn2;
-                                       if (strncmp(w, "md_d", 4)==0)
-                                               dn2 = -1-strtoul(w+4, &ep, 10);
-                                       else
-                                               dn2 = strtoul(w+2, &ep, 10);
+                                       int dn2 = devname2devnum(w);
                                        ih = &all;
                                        while (ih != insert_here && *ih &&
                                               (*ih)->devnum != dn2)
@@ -272,7 +268,7 @@ void mdstat_wait(int seconds)
        select(mdstat_fd >2 ? mdstat_fd+1:3, NULL, NULL, &fds, &tm);
 }
 
-void mdstat_wait_fd(int fd)
+void mdstat_wait_fd(int fd, const sigset_t *sigmask)
 {
        fd_set fds, rfds;
 
@@ -282,7 +278,8 @@ void mdstat_wait_fd(int fd)
                FD_SET(mdstat_fd, &fds);
        FD_SET(fd, &rfds);
 
-       select(mdstat_fd >2 ? mdstat_fd+1:3, &rfds, NULL, &fds, NULL);
+       pselect(mdstat_fd >2 ? mdstat_fd+1:3, &rfds, NULL, &fds,
+               NULL, sigmask);
 }
 
 int mddev_busy(int devnum)