From 27dec8fae303ab356aa786e20414f89d60be08a4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 2 Oct 2008 16:07:21 -0700 Subject: quiet WaitClean() Signed-off-by: Dan Williams --- Monitor.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Monitor.c') diff --git a/Monitor.c b/Monitor.c index a0803909..1c190577 100644 --- a/Monitor.c +++ b/Monitor.c @@ -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); -- cgit v1.2.3