From 9897debd4db0d3df348d787f1e798422819e446f Mon Sep 17 00:00:00 2001 From: David Cooper Date: Fri, 12 May 2017 09:51:19 -0400 Subject: [PATCH] Prevent broken pipe error When the `--log`, `--logging`, or `--logfile ` option is being used and testssl.sh is stopped, a "printf: write error: Broken pipe" message tends to appear. From what I can tell, this is a result of the `tee` process being killed before the `cleanup ()` function completes. At the moment, `cleanup ()` doesn't write very much to `stdout`, but if parallel mass testing is performed, then `cleanup ()` may try to write the results of several previously completed tests. This PR fixes the problem by adding the `-i` option ("ignore interrupt signals") to `tee`. Note that I have tested this on a Linux desktop and an OS X laptop, but don't have a MS Windows computer on which to test this change. --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index b0db28c..7b9e8d1 100755 --- a/testssl.sh +++ b/testssl.sh @@ -11484,7 +11484,7 @@ prepare_logging() { tmln_out "## at $HNAME:$OPENSSL_LOCATION" >>"$LOGFILE" tmln_out "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE" >>"$LOGFILE" tmln_out "## version openssl: \"$OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n" >>"$LOGFILE" - exec > >(tee -a "$LOGFILE") + exec > >(tee -a -i "$LOGFILE") }