Skip to content

Commit fa4170b

Browse files
Use string comparison because SIGURG is not available on all platforms
2 parents de18b49 + 1223c62 commit fa4170b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

proc_parent.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ func (mp *parent) handleSignal(s os.Signal) {
136136
if s == os.Interrupt {
137137
mp.Supervise = false
138138
}
139-
if s != syscall.SIGURG {
139+
//do a string comparison instead of using syscall.SIGURG
140+
//because windows will fail to build otherwise
141+
if s.String() != "urgent I/O condition" {
140142
mp.debugf("proxying signal (%s)", s)
141143
}
142144
mp.sendSignal(s)
@@ -146,7 +148,9 @@ func (mp *parent) handleSignal(s os.Signal) {
146148
mp.debugf("interupt with no child")
147149
os.Exit(1)
148150
} else {
149-
if s != syscall.SIGURG {
151+
//do a string comparison instead of using syscall.SIGURG
152+
//because windows will fail to build otherwise
153+
if s.String() != "urgent I/O condition" {
150154
mp.debugf("signal discarded (%s), no child process", s)
151155
}
152156
}
@@ -158,7 +162,9 @@ func (mp *parent) sendSignal(s os.Signal) {
158162
mp.debugf("signal (%s) failed (%s), assuming child process died unexpectedly", s, err)
159163
//if we receive a SIGURG during shutdown
160164
//don't exit with an error code
161-
if !mp.Supervise && s != syscall.SIGURG {
165+
//do a string comparison instead of using syscall.SIGURG
166+
//because windows will fail to build otherwise
167+
if !mp.Supervise && s.String() != "urgent I/O condition" {
162168
os.Exit(1)
163169
}
164170
}

0 commit comments

Comments
 (0)