// Reports whether the signal was sent. If not, the caller typically crashes the program.
func sigsend(s uint32) bool {
bit := uint32(1) << uint(s&31)
- if !sig.inuse || s < 0 || int(s) >= 32*len(sig.wanted) || sig.wanted[s/32]&bit == 0 {
+ if !sig.inuse || s >= uint32(32*len(sig.wanted)) || sig.wanted[s/32]&bit == 0 {
return false
}
return
}
- if int(s) >= len(sig.wanted)*32 {
+ if s >= uint32(len(sig.wanted)*32) {
return
}
sig.wanted[s/32] |= 1 << (s & 31)
// Must only be called from a single goroutine at a time.
func signal_disable(s uint32) {
- if int(s) >= len(sig.wanted)*32 {
+ if s >= uint32(len(sig.wanted)*32) {
return
}
sig.wanted[s/32] &^= 1 << (s & 31)
// Must only be called from a single goroutine at a time.
func signal_ignore(s uint32) {
- if int(s) >= len(sig.wanted)*32 {
+ if s >= uint32(len(sig.wanted)*32) {
return
}
sig.wanted[s/32] &^= 1 << (s & 31)