Skip to content

Commit

Permalink
Revert "Reapply: Add an error message to the default SIGPIPE handler"
Browse files Browse the repository at this point in the history
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: llvm#59037
Link: ClangBuiltLinux/linux#1651

Differential Revision: https://reviews.llvm.org/D138244

(cherry picked from commit 4787efa)
  • Loading branch information
bwendling authored and tstellar committed Nov 23, 2022
1 parent 25a36ca commit e6e61e9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
4 changes: 0 additions & 4 deletions llvm/lib/Support/Unix/Signals.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
26 changes: 0 additions & 26 deletions llvm/test/Support/unix03-sigpipe-exit.test

This file was deleted.

0 comments on commit e6e61e9

Please sign in to comment.