From: NeilBrown Date: Thu, 22 Dec 2011 23:49:07 +0000 (+1100) Subject: Assemble: make some plurals conditional. X-Git-Tag: mdadm-3.2.3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=576d02800287e9d57d6f221cf418d07cdd7597a4;p=thirdparty%2Fmdadm.git Assemble: make some plurals conditional. "1 devices" is ugly. Fix it. Signed-off-by: NeilBrown --- diff --git a/Assemble.c b/Assemble.c index 74fb6a32..c6ef736d 100644 --- a/Assemble.c +++ b/Assemble.c @@ -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; } } diff --git a/Incremental.c b/Incremental.c index ebdce80f..78c97129 100644 --- a/Incremental.c +++ b/Incremental.c @@ -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);