]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
allow add_to_super to return errors
[thirdparty/mdadm.git] / super1.c
index 4cfd786009a6c9a8b24c944d0fea9f44f04b3321..9446948ab3cde218f0e3b487a8db599aae03fd26 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -353,9 +353,11 @@ static void brief_examine_super1(struct supertype *st)
        else if (sb->set_name[0])
                nm = sb->set_name;
        else
-               nm = "??";
+               nm = NULL;
 
-       printf("ARRAY /dev/md/%s level=%s ", nm, c?c:"-unknown-");
+       printf("ARRAY%s%s level=%s ",
+              nm ? " /dev/md/":"", nm,
+              c?c:"-unknown-");
        sb_offset = __le64_to_cpu(sb->super_offset);
        if (sb_offset <= 4)
                printf("metadata=1.1 ");
@@ -794,7 +796,7 @@ struct devinfo {
 };
 #ifndef MDASSEMBLE
 /* Add a device to the superblock being created */
-static void add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
+static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
                          int fd, char *devname)
 {
        struct mdp_superblock_1 *sb = st->sb;
@@ -820,6 +822,8 @@ static void add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
        di->disk = *dk;
        di->next = NULL;
        *dip = di;
+
+       return 0;
 }
 #endif