From 812aa6c9ee4a0badfdaf239e401129bf32caec46 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Tue, 18 Oct 2022 10:34:36 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20print=20error=20on=20EPIPE=20in?= =?UTF-8?q?=20vrps=20to=20stdout.=20(#807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit suppresses the error message when the vrps command is outputting the data set to stdout and receives a broken pipe error. --- src/operation.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/operation.rs b/src/operation.rs index 62745ed..5764d25 100644 --- a/src/operation.rs +++ b/src/operation.rs @@ -838,10 +838,16 @@ impl Vrps { } }; if let Err(err) = res { - error!( - "Failed to output result: {}", - err - ); + // Surpress an error message for broken pipe on stdout. + if + self.output.is_some() || + err.kind() != io::ErrorKind::BrokenPipe + { + error!( + "Failed to output result: {}", + err + ); + } Err(ExitError::Generic) } else if self.complete && !metrics.rsync_complete() {