diff options
author | Vedant Kumar <vsk@apple.com> | 2019-12-04 19:21:14 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-12-04 19:38:19 -0800 |
commit | 9a3f892d018238dce5181e458905311db8e682f5 (patch) | |
tree | 9177171b134bca11dcf234d8be8b4e8922245121 /llvm/lib/Support/Unix | |
parent | 1de214fa413d7c3c0fab832fa1f9857606d2ec78 (diff) | |
download | bcm5719-llvm-9a3f892d018238dce5181e458905311db8e682f5.tar.gz bcm5719-llvm-9a3f892d018238dce5181e458905311db8e682f5.zip |
[Signal] Allow one-shot SIGPIPE handler to be reached
As SIGPIPE is no longer in the IntSigs array, handle SIGPIPE before
handling any interrupt signals.
Thanks to Alexandre Ganea for pointing out the issue here.
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 8c26fa9b8f2..2b31672670c 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -361,16 +361,16 @@ static RETSIGTYPE SignalHandler(int Sig) { { RemoveFilesToRemove(); + if (Sig == SIGPIPE) + if (auto OldOneShotPipeFunction = + OneShotPipeSignalFunction.exchange(nullptr)) + return OldOneShotPipeFunction(); + if (std::find(std::begin(IntSigs), std::end(IntSigs), Sig) != std::end(IntSigs)) { if (auto OldInterruptFunction = InterruptFunction.exchange(nullptr)) return OldInterruptFunction(); - if (Sig == SIGPIPE) - if (auto OldOneShotPipeFunction = - OneShotPipeSignalFunction.exchange(nullptr)) - return OldOneShotPipeFunction(); - raise(Sig); // Execute the default handler. return; } |