summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-09-15 20:58:43 -0700
committerDan Williams <dan.j.williams@intel.com>2008-09-15 20:58:43 -0700
commit295646b3d59c7d8d8c389ff320b30e61552ba331 (patch)
tree150b20b04a0c112123e35cbca62e40ac7d525918 /mdstat.c
parent313a4a82f130e6668ba0f4550200662e168aa945 (diff)
mdmon: recreate socket/pid file on SIGHUP
Allow mdmon to start while /var/run/mdadm is readonly. Later a SIGHUP can trigger mdmon to drop its pid and socket once /var/run/mdadm is writable. Of course one needs the pid to send a HUP, that can be stored in a distribution specific rw-init directory... For now, rely on a killall -HUP mdmon to get the files dumped. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdstat.c b/mdstat.c
index 00714b48..ebdfc67b 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -280,7 +280,8 @@ void mdstat_wait_fd(int fd, const sigset_t *sigmask)
FD_ZERO(&rfds);
if (mdstat_fd >= 0)
FD_SET(mdstat_fd, &fds);
- FD_SET(fd, &rfds);
+ if (fd >= 0)
+ FD_SET(fd, &rfds);
if (mdstat_fd > maxfd)
maxfd = mdstat_fd;