]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
Various compile fixes.
[thirdparty/mdadm.git] / Monitor.c
index adc89d080a5bf7fd196953469b0c0d6a581760a9..d3795b1713d8e07226c4f83666ce01459e7452e9 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -291,7 +291,8 @@ static int check_one_sharer(int scan)
        struct stat buf;
        fp = fopen("/var/run/mdadm/autorebuild.pid", "r");
        if (fp) {
-               fscanf(fp, "%d", &pid);
+               if (fscanf(fp, "%d", &pid) != 1)
+                       pid = -1;
                sprintf(dir, "/proc/%d", pid);
                rv = stat(dir, &buf);
                if (rv != -1) {
@@ -778,7 +779,7 @@ static dev_t choose_spare(struct state *from, struct state *to,
                        if (from->spare_group)
                                pol_add(&pol, pol_domain,
                                        from->spare_group, NULL);
-                       if (domain_test(domlist, pol, to->metadata->ss->name))
+                       if (domain_test(domlist, pol, to->metadata->ss->name) == 1)
                            dev = from->devid[d];
                        dev_policy_free(pol);
                }