]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdstat.c
RebuildMap: handle missing disks
[thirdparty/mdadm.git] / mdstat.c
index 00714b485905be156fb33ce2d009b02171cd8154..ebdfc67bf6d46705e1ebcb74212299b2aa47b66c 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -280,7 +280,8 @@ void mdstat_wait_fd(int fd, const sigset_t *sigmask)
        FD_ZERO(&rfds);
        if (mdstat_fd >= 0)
                FD_SET(mdstat_fd, &fds);
-       FD_SET(fd, &rfds);
+       if (fd >= 0)
+               FD_SET(fd, &rfds);
        if (mdstat_fd > maxfd)
                maxfd = mdstat_fd;