]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: make some plurals conditional.
authorNeilBrown <neilb@suse.de>
Thu, 22 Dec 2011 23:49:07 +0000 (10:49 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 22 Dec 2011 23:49:07 +0000 (10:49 +1100)
"1 devices" is ugly.  Fix it.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
Incremental.c

index 74fb6a32c6f9032e689c45bfd988c2e237ff1262..c6ef736d6379b4c20010fccb6d66343c54b23947 100644 (file)
@@ -1614,12 +1614,14 @@ int assemble_container_content(struct supertype *st, int mdfd,
                if (verbose >= 0) {
                        if (err)
                                fprintf(stderr, Name
-                                       ": array %s now has %d devices",
-                                       chosen_name, working + preexist);
+                                       ": array %s now has %d device%s",
+                                       chosen_name, working + preexist,
+                                       working + preexist == 1 ? "":"s");
                        else
                                fprintf(stderr, Name
-                                       ": Started %s with %d devices",
-                                       chosen_name, working + preexist);
+                                       ": Started %s with %d device%s",
+                                       chosen_name, working + preexist,
+                                       working + preexist == 1 ? "":"s");
                        if (preexist)
                                fprintf(stderr, " (%d new)", working);
                        if (expansion)
@@ -1634,9 +1636,9 @@ int assemble_container_content(struct supertype *st, int mdfd,
        } else {
                if (verbose >= 0)
                        fprintf(stderr, Name
-                               ": %s assembled with %d devices but "
+                               ": %s assembled with %d device%s but "
                                "not started\n",
-                               chosen_name, working);
+                               chosen_name, working, working == 1 ? "":"s");
                return 1;
        }
 }
index ebdce80f24ae58702cfe568509ba5afdd9230c63..78c9712981883a467b352e9e2a085baded93b2f8 100644 (file)
@@ -450,8 +450,9 @@ int Incremental(char *devname, int verbose, int runstop,
                sysfs_uevent(sra, "change");
                if (verbose >= 0)
                        fprintf(stderr, Name
-                               ": container %s now has %d devices\n",
-                               chosen_name, info.array.working_disks);
+                               ": container %s now has %d device%s\n",
+                               chosen_name, info.array.working_disks,
+                               info.array.working_disks==1?"":"s");
                wait_for(chosen_name, mdfd);
                if (st->ss->external)
                        devnum = fd2devnum(mdfd);