summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-05-10 16:17:12 +1000
committerNeilBrown <neilb@suse.de>2011-05-10 16:17:12 +1000
commit0f23aa88f81127eae744d60eedd4884f021562d0 (patch)
treeba1e8d2580b719277f0df8b98beea0a859b5dd08 /config.c
parent815c8a7e0b11b69331211b59b880ba50f3ed2b5e (diff)
config: restore the possibility of a NULL homehost
As homehost defaults to the system name it is not possible to specify a NULL homehost. This patch restored this ability with either --homehost="" or --homehost="<none>". This allows the creation of v1.x arrays without a "hostname:" prefix in the name. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'config.c')
-rw-r--r--config.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/config.c b/config.c
index 0dbe61ed..ad75411c 100644
--- a/config.c
+++ b/config.c
@@ -589,9 +589,12 @@ void homehostline(char *line)
for (w=dl_next(line); w != line ; w=dl_next(w)) {
if (strcasecmp(w, "<ignore>")==0)
require_homehost = 0;
- else if (home_host == NULL)
- home_host = strdup(w);
- else
+ else if (home_host == NULL) {
+ if (strcasecmp(w, "<none>")==0)
+ home_host = strdup("");
+ else
+ home_host = strdup(w);
+ }else
fprintf(stderr, Name ": excess host name on HOMEHOST line: %s - ignored\n",
w);
}