forked from OSchip/llvm-project
[Signal] Re-raise SIGPIPE if the handler is uninstalled
Instead of falling through to RunSignalHandlers after the SIGPIPE handler is uninstalled and we get a SIGPIPE, re-raise the signal, just like we do for other IntSigs. This was discussed and informally OK'd here: https://reviews.llvm.org/rG9a3f892d018238dce5181e458905311db8e682f5#856804
This commit is contained in:
parent
ec13f6c3e5
commit
bf401256ed
|
@ -382,10 +382,12 @@ static RETSIGTYPE SignalHandler(int Sig) {
|
|||
OneShotPipeSignalFunction.exchange(nullptr))
|
||||
return OldOneShotPipeFunction();
|
||||
|
||||
if (llvm::is_contained(IntSigs, Sig)) {
|
||||
bool IsIntSig = llvm::is_contained(IntSigs, Sig);
|
||||
if (IsIntSig)
|
||||
if (auto OldInterruptFunction = InterruptFunction.exchange(nullptr))
|
||||
return OldInterruptFunction();
|
||||
|
||||
if (Sig == SIGPIPE || IsIntSig) {
|
||||
raise(Sig); // Execute the default handler.
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue