]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - config.c
imsm: fix imsm_map.num_domains
[thirdparty/mdadm.git] / config.c
index d9db115284b06b93c9920ba4b51bb0fe0cb77b1c..7e09b5ca8c58604e0af91591b8b9feb042ad4250 100644 (file)
--- a/config.c
+++ b/config.c
@@ -261,6 +261,7 @@ mddev_dev_t load_partitions(void)
                d->devname = strdup(name);
                d->next = rv;
                d->used = 0;
+               d->content = NULL;
                rv = d;
        }
        fclose(f);
@@ -290,6 +291,7 @@ mddev_dev_t load_containers(void)
                        }
                        d->next = rv;
                        d->used = 0;
+                       d->content = NULL;
                        rv = d;
                }
        free_mdstat(mdstat);
@@ -598,7 +600,7 @@ void mailfromline(char *line)
                else {
                        char *t = NULL;
 
-                       if (asprintf(&t, "%s %s", alert_mail_from, w) > 0) {
+                       if (xasprintf(&t, "%s %s", alert_mail_from, w) > 0) {
                                free(alert_mail_from);
                                alert_mail_from = t;
                        }
@@ -781,9 +783,11 @@ mddev_dev_t conf_get_devs()
 
        load_conffile();
 
-       if (cdevlist == NULL)
-               /* default to 'partitions */
+       if (cdevlist == NULL) {
+               /* default to 'partitions' and 'containers' */
                dlist = load_partitions();
+               append_dlist(&dlist, load_containers());
+       }
 
        for (cd=cdevlist; cd; cd=cd->next) {
                if (strcasecmp(cd->name, "partitions")==0)
@@ -801,6 +805,7 @@ mddev_dev_t conf_get_devs()
                        t->devname = strdup(globbuf.gl_pathv[i]);
                        t->next = dlist;
                        t->used = 0;
+                       t->content = NULL;
                        dlist = t;
 /*     printf("one dev is %s\n", t->devname);*/
                }