Skip to content

Commit

Permalink
TMP: Only ignore SIG_IGN
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Feb 13, 2025
1 parent 02296bc commit e403736
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/runtime/signal_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ func sigenable(sig uint32) {
enableSigChan <- sig
<-maskUpdatedChan
if atomic.Cas(&handlingSig[sig], 0, 1) {
// atomic.Storeuintptr(&fwdSig[sig], getsig(sig))
h := getsig(sig)
if h != _SIG_IGN {
atomic.Storeuintptr(&fwdSig[sig], h)
}
setsig(sig, abi.FuncPCABIInternal(sighandler))
}
}
Expand Down Expand Up @@ -232,7 +235,10 @@ func sigdisable(sig uint32) bool {
// we should remove the one we installed.
if sigInstallGoHandler(sig) {
if atomic.Cas(&handlingSig[sig], 0, 1) {
// atomic.Storeuintptr(&fwdSig[sig], getsig(sig))
h := getsig(sig)
if h != _SIG_IGN {
atomic.Storeuintptr(&fwdSig[sig], h)
}
setsig(sig, abi.FuncPCABIInternal(sighandler))
}
return false
Expand Down

0 comments on commit e403736

Please sign in to comment.