]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
util: fix test for text_version
[thirdparty/mdadm.git] / Monitor.c
index af531294cc53c908ea7a1b88f7a1e0870c5c62bf..e43175f186d878acc6c0f5591ea1187f5bc8e0b9 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -168,10 +168,18 @@ int Monitor(mddev_dev_t devlist,
                        struct state *st;
                        if (mdlist->devname == NULL)
                                continue;
+                       if (strcasecmp(mdlist->devname, "<ignore>") == 0)
+                               continue;
                        st = malloc(sizeof *st);
                        if (st == NULL)
                                continue;
-                       st->devname = strdup(mdlist->devname);
+                       if (mdlist->devname[0] == '/')
+                               st->devname = strdup(mdlist->devname);
+                       else {
+                               st->devname = malloc(8+strlen(mdlist->devname)+1);
+                               strcpy(strcpy(st->devname, "/dev/md/"),
+                                      mdlist->devname);
+                       }
                        st->utime = 0;
                        st->next = statelist;
                        st->err = 0;
@@ -706,7 +714,7 @@ int WaitClean(char *dev, int verbose)
                        if (sysfs_match_word(buf, clean_states) <= 4)
                                break;
                        FD_SET(state_fd, &fds);
-                       rv = select(state_fd + 1, &fds, NULL, NULL, &tm);
+                       rv = select(state_fd + 1, NULL, NULL, &fds, &tm);
                        if (rv < 0 && errno != EINTR)
                                break;
                        lseek(state_fd, 0, SEEK_SET);