summaryrefslogtreecommitdiffstats
path: root/managemon.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-27 09:18:41 +1000
committerNeil Brown <neilb@suse.de>2008-05-27 09:18:41 +1000
commite0d6609fe6b0fe6a74705d1f1c1cf4a0d3a71db8 (patch)
tree4e1a2f6c44d2ae2a943de26178edab3462e723c9 /managemon.c
parent5869a76c90aa0725e665d3c7bd6c7ab021d24fd4 (diff)
downloadmdadm-e0d6609fe6b0fe6a74705d1f1c1cf4a0d3a71db8.tar.gz
mdadm-e0d6609fe6b0fe6a74705d1f1c1cf4a0d3a71db8.tar.xz
mdadm-e0d6609fe6b0fe6a74705d1f1c1cf4a0d3a71db8.zip
Exit when there are no more arrays to manage.
Diffstat (limited to 'managemon.c')
-rw-r--r--managemon.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/managemon.c b/managemon.c
index aa10a99..971dcd1 100644
--- a/managemon.c
+++ b/managemon.c
@@ -382,6 +382,8 @@ void wake_me(int sig)
woke = 1;
}
+int exit_now = 0;
+int manager_ready = 0;
void do_manager(struct supertype *container)
{
struct mdstat_ent *mdstat;
@@ -395,6 +397,9 @@ void do_manager(struct supertype *container)
do {
woke = 0;
+ if (exit_now)
+ exit(0);
+
mdstat = mdstat_read(1, 0);
manage(mdstat, container);
@@ -405,6 +410,7 @@ void do_manager(struct supertype *container)
remove_old();
+ manager_ready = 1;
sigprocmask(SIG_SETMASK, &block, &orig);
if (woke == 0)
mdstat_wait_fd(container->sock, &orig);