Skip to content

Commit 4787efa

Browse files
committed
Revert "Reapply: Add an error message to the default SIGPIPE handler"
This patch is spamming compiles with unhelpful and confusing messages. E.g. the Linux kernel uses "grep -q" in several places. It's meant to quit with a return code of zero when the first match is found. This can cause a SIGPIPE signal, but that's expected, and there's no way to turn this error message off to avoid spurious error messages. UNIX03 apparently doesn't require printing an error message on SIGPIPE, but specifically when there's an error on the stdout stream in a normal program flow, e.g. when SIGPIPE trap is disabled. A separate patch is planned to address the specific case we care most about (involving llvm-nm). This reverts commit b89bcef. Link: #59037 Link: ClangBuiltLinux/linux#1651 Differential Revision: https://reviews.llvm.org/D138244
1 parent 7fc57d7 commit 4787efa

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

llvm/lib/Support/Unix/Signals.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,6 @@ void llvm::sys::SetOneShotPipeSignalFunction(void (*Handler)()) {
432432
}
433433

434434
void llvm::sys::DefaultOneShotPipeSignalHandler() {
435-
// UNIX03 conformance requires a non-zero exit code and an error message
436-
// to stderr when writing to a closed stdout fails.
437-
errs() << "error: write on a pipe with no reader\n";
438-
439435
// Send a special return code that drivers can check for, from sysexits.h.
440436
exit(EX_IOERR);
441437
}

llvm/test/Support/unix03-sigpipe-exit.test

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)