]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
Various compile fixes.
[thirdparty/mdadm.git] / Monitor.c
index 452f62d8d1b13cc78ee6c7897c1f135ebf6fb30f..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) {