diff options
author | Neil Brown <neilb@suse.de> | 2006-05-19 07:50:08 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-05-19 07:50:08 +0200 |
commit | 997aed5deeabc74eefcf37a0f042ac8707dfe227 (patch) | |
tree | 96205aa20830a65b2e88cd5fd863e4bdcb07df4d /config.c | |
parent | Improve code for recognising config lines. (diff) | |
download | mdadm-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.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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); |