]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Assemble: allow members of containers to be assembled and auto-assembled.
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index b2ec6f904163203252935898257e17147184c908..2bd963a58c2fbf9e3158b88bc2cb5938971ddd8b 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -256,6 +256,7 @@ int main(int argc, char *argv[])
                                        dv->writemostly = writemostly;
                                        dv->re_add = re_add;
                                        dv->used = 0;
+                                       dv->content = NULL;
                                        dv->next = NULL;
                                        *devlistend = dv;
                                        devlistend = &dv->next;
@@ -308,6 +309,8 @@ int main(int argc, char *argv[])
                        dv->disposition = devmode;
                        dv->writemostly = writemostly;
                        dv->re_add = re_add;
+                       dv->used = 0;
+                       dv->content = NULL;
                        dv->next = NULL;
                        *devlistend = dv;
                        devlistend = &dv->next;
@@ -997,7 +1000,7 @@ int main(int argc, char *argv[])
 
        if (homehost == NULL)
                homehost = conf_get_homehost();
-       if (homehost && strcmp(homehost, "<system>")==0) {
+       if (homehost == NULL || strcmp(homehost, "<system>")==0) {
                if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) {
                        sys_hostname[sizeof(sys_hostname)-1] = 0;
                        homehost = sys_hostname;