]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - managemon.c
mdmon: don't monitor /proc/mounts to decide when to create .pid file.
[thirdparty/mdadm.git] / managemon.c
index 2a73d4b050a2dc7afb6498fee43ff38e4fd0054e..e01d13b9445c1329722e03f762de9c03a4838b61 100644 (file)
@@ -677,14 +677,12 @@ void do_manager(struct supertype *container)
 {
        struct mdstat_ent *mdstat;
        sigset_t set;
-       int proc_fd;
 
        sigprocmask(SIG_UNBLOCK, NULL, &set);
        sigdelset(&set, SIGUSR1);
        sigdelset(&set, SIGHUP);
        sigdelset(&set, SIGALRM);
        sigdelset(&set, SIGTERM);
-       proc_fd = open("/proc/mounts", O_RDONLY);
 
        do {
 
@@ -711,10 +709,6 @@ void do_manager(struct supertype *container)
                                        char *dir = ALT_RUN;
                                        if (mkdir(dir, 0600) < 0 && errno != EEXIST)
                                                dir = NULL;
-                               } else {
-                                       if (proc_fd >= 0)
-                                               close(proc_fd);
-                                       proc_fd = -1;
                                }
                                if (dir && !sigterm &&
                                    (container->sock < 0 ||
@@ -742,7 +736,7 @@ void do_manager(struct supertype *container)
                        wakeup_monitor();
 
                if (update_queue == NULL)
-                       mdstat_wait_fd(container->sock, proc_fd, &set);
+                       mdstat_wait_fd(container->sock, &set);
                else
                        /* If an update is happening, just wait for signal */
                        pselect(0, NULL, NULL, NULL, NULL, &set);