[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:
Vedant Kumar 2021-01-08 11:12:08 -08:00
parent ec13f6c3e5
commit bf401256ed
1 changed files with 5 additions and 3 deletions

View File

@ -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;
}