X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=mdadm.c;h=2bd963a58c2fbf9e3158b88bc2cb5938971ddd8b;hp=f3086a92a8483484c7c02100c8cf537e7d9ecf7b;hb=9008ed1c9623b7c11775ea8a7be17eb1bde5fd09;hpb=7f91af49ad09adc1b93346f7ad654e25534f35b7 diff --git a/mdadm.c b/mdadm.c index f3086a92..2bd963a5 100644 --- 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, "")==0) { + if (homehost == NULL || strcmp(homehost, "")==0) { if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) { sys_hostname[sizeof(sys_hostname)-1] = 0; homehost = sys_hostname; @@ -1082,16 +1085,6 @@ int main(int argc, char *argv[]) exit(1); } for (; array_list; array_list = array_list->next) { - mdfd = open_mddev(array_list->devname, 0); - if (mdfd >= 0) { - mdu_array_info_t array; - /* skip if already assembled */ - if (ioctl(mdfd, GET_ARRAY_INFO, &array)>=0) { - cnt++; - close(mdfd); - continue; - } - } if (array_list->autof == 0) array_list->autof = autof;