]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - monitor.c
Improve partition table code.
[thirdparty/mdadm.git] / monitor.c
index 58752a85c8428aa37c4babf7045e2d32376ecd95..e43e545ce196f1370ad68b78c9b02dac67ae89f9 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -75,7 +75,7 @@ static unsigned long long read_resync_start(int fd)
        if (n <= 0)
                return 0;
        if (strncmp(buf, "none", 4) == 0)
-               return ~0ULL;
+               return MaxSector;
        else
                return strtoull(buf, NULL, 10);
 }
@@ -481,7 +481,11 @@ static int wait_and_act(struct supertype *container, int nowait)
                                dprintf("caught sigterm, all clean... exiting\n");
                        else
                                dprintf("no arrays to monitor... exiting\n");
-                       remove_pidfile(container->devname);
+                       if (!sigterm)
+                               /* On SIGTERM, someone (the take-over mdmon) will
+                                * clean up
+                                */
+                               remove_pidfile(container->devname);
                        exit_now = 1;
                        signal_manager();
                        exit(0);