diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-10-03 01:07:21 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-10-15 23:43:57 +0200 |
commit | 27dec8fae303ab356aa786e20414f89d60be08a4 (patch) | |
tree | a6b7743bf62ccbf85ee51b4116f7b4cfde731117 /Monitor.c | |
parent | mdmon: --switch-root (diff) | |
download | mdadm-27dec8fae303ab356aa786e20414f89d60be08a4.tar.xz mdadm-27dec8fae303ab356aa786e20414f89d60be08a4.zip |
quiet WaitClean()
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'Monitor.c')
-rw-r--r-- | Monitor.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -632,7 +632,7 @@ int Wait(char *dev) static char *clean_states[] = { "clear", "inactive", "readonly", "read-auto", "clean", NULL }; -int WaitClean(char *dev) +int WaitClean(char *dev, int verbose) { int fd; struct mdinfo *mdi; @@ -641,15 +641,17 @@ int WaitClean(char *dev) fd = open(dev, O_RDONLY); if (fd < 0) { - fprintf(stderr, Name ": Couldn't open %s: %s\n", dev, strerror(errno)); + if (verbose) + fprintf(stderr, Name ": Couldn't open %s: %s\n", dev, strerror(errno)); return 1; } devnum = fd2devnum(fd); mdi = sysfs_read(fd, devnum, GET_VERSION|GET_LEVEL|GET_SAFEMODE); if (!mdi) { - fprintf(stderr, Name ": Failed to read sysfs attributes for " - "%s\n", dev); + if (verbose) + fprintf(stderr, Name ": Failed to read sysfs attributes for " + "%s\n", dev); close(fd); return 0; } @@ -714,7 +716,7 @@ int WaitClean(char *dev) rv = 0; } else rv = 1; - if (rv) + if (rv && verbose) fprintf(stderr, Name ": Error waiting for %s to be clean\n", dev); |