summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-07-18 16:37:24 +1000
committerNeilBrown <neilb@suse.de>2008-07-18 16:37:24 +1000
commit4b9d39fc17b2449bfc8c696e5137cefd676841c2 (patch)
treebf21282b4fd57224c6edabd33a0600ddf327dc46 /Manage.c
parent9fe32043178f221526b6d59f3bbce58f777089da (diff)
downloadmdadm-4b9d39fc17b2449bfc8c696e5137cefd676841c2.tar.gz
mdadm-4b9d39fc17b2449bfc8c696e5137cefd676841c2.tar.xz
mdadm-4b9d39fc17b2449bfc8c696e5137cefd676841c2.zip
Manage: fixed some error message in --stop
Explain the meaning of 'quiet' explicitly, and fix some grammar and formatting. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/Manage.c b/Manage.c
index 0c6b59c..9003105 100644
--- a/Manage.c
+++ b/Manage.c
@@ -78,13 +78,18 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
{
/* Run or stop the array. array must already be configured
* required >= 0.90.0
+ * Only print failure messages if quiet == 0;
+ * quiet > 0 means really be quiet
+ * quiet < 0 means we will try again if it fails.
*/
mdu_param_t param; /* unused */
if (runstop == -1 && md_get_version(fd) < 9000) {
if (ioctl(fd, STOP_MD, 0)) {
- if (!quiet) fprintf(stderr, Name ": stopping device %s failed: %s\n",
- devname, strerror(errno));
+ if (quiet == 0) fprintf(stderr,
+ Name ": stopping device %s "
+ "failed: %s\n",
+ devname, strerror(errno));
return 1;
}
}
@@ -125,9 +130,9 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
close(fd);
if (sysfs_set_str(mdi, NULL,
"array_state", "inactive") < 0) {
- if (quiet==0)
+ if (quiet == 0)
fprintf(stderr, Name
- ": fail to stop array %s: %s\n",
+ ": failed to stop array %s: %s\n",
devname, strerror(errno));
return 1;
}
@@ -144,9 +149,9 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
sysfs_free(mdi);
if (fd >= 0 && ioctl(fd, STOP_ARRAY, NULL)) {
- if (quiet==0)
+ if (quiet == 0)
fprintf(stderr, Name
- ": fail to stop array %s: %s\n",
+ ": failed to stop array %s: %s\n",
devname, strerror(errno));
return 1;
}