From d0bd3fc88be54c4e11f49cfa31e427700bb1e9af Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 24 Oct 2019 12:08:24 -0700 Subject: Revert "Disable exit-on-SIGPIPE in lldb" This reverts commit 32ce14e55e5a99dd99c3b4fd4bd0ccaaf2948c30. In post-commit review, Pavel pointed out that there's a simpler way to ignore SIGPIPE in lldb that doesn't rely on llvm's handlers. --- llvm/lib/Support/Unix/Signals.inc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'llvm/lib/Support/Unix') diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 5e0cde4a81e..be05eabfb2e 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -82,18 +82,12 @@ using namespace llvm; static RETSIGTYPE SignalHandler(int Sig); // defined below. static RETSIGTYPE InfoSignalHandler(int Sig); // defined below. -static void DefaultPipeSignalFunction() { - exit(EX_IOERR); -} - using SignalHandlerFunctionType = void (*)(); /// The function to call if ctrl-c is pressed. static std::atomic InterruptFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic InfoSignalFunction = ATOMIC_VAR_INIT(nullptr); -static std::atomic PipeSignalFunction = - ATOMIC_VAR_INIT(DefaultPipeSignalFunction); namespace { /// Signal-safe removal of files. @@ -369,8 +363,7 @@ static RETSIGTYPE SignalHandler(int Sig) { // Send a special return code that drivers can check for, from sysexits.h. if (Sig == SIGPIPE) - if (SignalHandlerFunctionType CurrentPipeFunction = PipeSignalFunction) - CurrentPipeFunction(); + exit(EX_IOERR); raise(Sig); // Execute the default handler. return; @@ -410,11 +403,6 @@ void llvm::sys::SetInfoSignalFunction(void (*Handler)()) { RegisterHandlers(); } -void llvm::sys::SetPipeSignalFunction(void (*Handler)()) { - PipeSignalFunction.exchange(Handler); - RegisterHandlers(); -} - // The public API bool llvm::sys::RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg) { -- cgit v1.2.3