From: Tim Northover Date: Thu, 12 May 2022 07:30:53 +0000 (+0100) Subject: Revert "Add an error message to the default SIGPIPE handler" X-Git-Tag: upstream/15.0.7~7958 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b53a45e14ad4fe81163b3592939f2f549207a31;p=platform%2Fupstream%2Fllvm.git Revert "Add an error message to the default SIGPIPE handler" It broke a PPC bot, for not immediately obvious reasons. --- diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 9426f84..575e2aa 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -432,10 +432,6 @@ void llvm::sys::SetOneShotPipeSignalFunction(void (*Handler)()) { } void llvm::sys::DefaultOneShotPipeSignalHandler() { - // UNIX03 conformance requires a non-zero exit code and an error message - // to stderr when writing to a closed stdout fails. - errs() << "error: write on a pipe with no reader\n"; - // Send a special return code that drivers can check for, from sysexits.h. exit(EX_IOERR); } diff --git a/llvm/test/tools/llvm-nm/unix03-sigpipe-exit.test b/llvm/test/tools/llvm-nm/unix03-sigpipe-exit.test deleted file mode 100644 index 50b5c08..0000000 --- a/llvm/test/tools/llvm-nm/unix03-sigpipe-exit.test +++ /dev/null @@ -1,17 +0,0 @@ -# Test that when nm tries to write to a closed stdout it will finish with -# a non-zero exit code and an error message on stderr. -# This is required for UNIX03 conformance. - -# UNSUPPORTED: system-windows - -# RUN: not %python %s llvm-nm llvm-nm 2>&1 | FileCheck %s -# CHECK: error: write on a pipe with no reader - -import subprocess -import sys - -with subprocess.Popen([sys.argv[1], sys.argv[2]], stdout=subprocess.PIPE) as process: - # Read single byte and immediately close pipe to trigger SIGPIPE. - process.stdout.read(1) - process.stdout.close() -sys.exit(process.returncode)