Skip to content

Commit

Permalink
Use string comparison because SIGURG is not available on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
trufflesteeeve authored Aug 8, 2023
2 parents de18b49 + 1223c62 commit fa4170b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions proc_parent.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ func (mp *parent) handleSignal(s os.Signal) {
if s == os.Interrupt {
mp.Supervise = false
}
if s != syscall.SIGURG {
//do a string comparison instead of using syscall.SIGURG
//because windows will fail to build otherwise
if s.String() != "urgent I/O condition" {
mp.debugf("proxying signal (%s)", s)
}
mp.sendSignal(s)
Expand All @@ -146,7 +148,9 @@ func (mp *parent) handleSignal(s os.Signal) {
mp.debugf("interupt with no child")
os.Exit(1)
} else {
if s != syscall.SIGURG {
//do a string comparison instead of using syscall.SIGURG
//because windows will fail to build otherwise
if s.String() != "urgent I/O condition" {
mp.debugf("signal discarded (%s), no child process", s)
}
}
Expand All @@ -158,7 +162,9 @@ func (mp *parent) sendSignal(s os.Signal) {
mp.debugf("signal (%s) failed (%s), assuming child process died unexpectedly", s, err)
//if we receive a SIGURG during shutdown
//don't exit with an error code
if !mp.Supervise && s != syscall.SIGURG {
//do a string comparison instead of using syscall.SIGURG
//because windows will fail to build otherwise
if !mp.Supervise && s.String() != "urgent I/O condition" {
os.Exit(1)
}
}
Expand Down

0 comments on commit fa4170b

Please sign in to comment.