diff options
author | Vedant Kumar <vsk@apple.com> | 2019-10-24 12:08:24 -0700 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-10-24 13:19:49 -0700 |
commit | d0bd3fc88be54c4e11f49cfa31e427700bb1e9af (patch) | |
tree | ef4c379867706eb435d84356414aae10984a5fd3 /llvm/lib/Support/Unix/Signals.inc | |
parent | 23b78364150cd946a8b111e87defdf179eecbc8f (diff) | |
download | bcm5719-llvm-d0bd3fc88be54c4e11f49cfa31e427700bb1e9af.tar.gz bcm5719-llvm-d0bd3fc88be54c4e11f49cfa31e427700bb1e9af.zip |
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.
Diffstat (limited to 'llvm/lib/Support/Unix/Signals.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 14 |
1 files changed, 1 insertions, 13 deletions
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<SignalHandlerFunctionType> InterruptFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic<SignalHandlerFunctionType> InfoSignalFunction = ATOMIC_VAR_INIT(nullptr); -static std::atomic<SignalHandlerFunctionType> 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) { |