summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-19 07:50:08 +0200
committerNeil Brown <neilb@suse.de>2006-05-19 07:50:08 +0200
commit997aed5deeabc74eefcf37a0f042ac8707dfe227 (patch)
tree96205aa20830a65b2e88cd5fd863e4bdcb07df4d /config.c
parentImprove code for recognising config lines. (diff)
downloadmdadm-997aed5deeabc74eefcf37a0f042ac8707dfe227.tar.xz
mdadm-997aed5deeabc74eefcf37a0f042ac8707dfe227.zip
Allow homehost to be set on command line or in config file
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'config.c')
-rw-r--r--config.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/config.c b/config.c
index ec9e3e16..8382cdfe 100644
--- a/config.c
+++ b/config.c
@@ -553,6 +553,20 @@ void programline(char *line)
}
}
+static char *home_host = NULL;
+void homehostline(char *line)
+{
+ char *w;
+
+ for (w=dl_next(line); w != line ; w=dl_next(w)) {
+ if (home_host == NULL)
+ home_host = strdup(w);
+ else
+ fprintf(stderr, Name ": excess host name on HOMEHOST line: %s - ignored\n",
+ w);
+ }
+}
+
int loaded = 0;
@@ -614,6 +628,9 @@ void load_conffile(char *conffile)
case CreateDev:
createline(line);
break;
+ case Homehost:
+ homehostline(line);
+ break;
default:
fprintf(stderr, Name ": Unknown keyword %s\n", line);
}
@@ -643,6 +660,12 @@ char *conf_get_program(char *conffile)
return alert_program;
}
+char *conf_get_homehost(char *conffile)
+{
+ load_conffile(conffile);
+ return home_host;
+}
+
struct createinfo *conf_get_create_info(char *conffile)
{
load_conffile(conffile);