]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - monitor.c
ddf: Set container_member from subarray in getinfo_super.
[thirdparty/mdadm.git] / monitor.c
index 524411e3a290140e7021be47dec4b8b11b7761cf..46d5e0a00380672285a2667c140e8324cc545721 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -242,7 +242,7 @@ static int read_and_act(struct active_array *a)
                 * readonly ???
                 */
                get_resync_start(a);
-               printf("Found a readonly array at %llu\n", a->resync_start);
+//             printf("Found a readonly array at %llu\n", a->resync_start);
                if (a->resync_start == ~0ULL)
                        a->next_state = read_auto; /* array is clean */
                else {
@@ -445,9 +445,9 @@ static int wait_and_act(struct supertype *container, int nowait)
                if (fd >= 0 || errno != EBUSY) {
                        /* OK, we are safe to leave */
                        dprintf("no arrays to monitor... exiting\n");
+                       remove_pidfile(container->devname);
                        exit_now = 1;
                        signal_manager();
-                       remove_pidfile(container->devname);
                        exit(0);
                }
        }
@@ -457,7 +457,8 @@ static int wait_and_act(struct supertype *container, int nowait)
                sigprocmask(SIG_UNBLOCK, NULL, &set);
                sigdelset(&set, SIGUSR1);
                rv = pselect(maxfd+1, &rfds, NULL, NULL, NULL, &set);
-
+               if (rv == -1 && errno == EINTR)
+                       rv = 0;
                #ifdef DEBUG
                dprint_wake_reasons(&rfds);
                #endif