aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_386.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-01-07 10:19:55 -0500
committerRuss Cox <rsc@golang.org>2016-01-08 15:34:03 +0000
commit81adfa508a81e24b8257571dd717845647607cbd (patch)
tree6da40730c40d4f3fd32e84d43b7a988d216761bc /src/runtime/signal_386.go
parent331a6055ab8785e77bd1331355d209bd7da2ae26 (diff)
downloadgo-81adfa508a81e24b8257571dd717845647607cbd.tar.gz
go-81adfa508a81e24b8257571dd717845647607cbd.zip
runtime: allow signal.Ignore of user-generated throwing signals
Today, signal.Ignore(syscall.SIGTRAP) does nothing while signal.Notify(make(chan os.Signal), syscall.SIGTRAP) correctly discards user-generated SIGTRAPs. The same applies to any signal that we throw on. Make signal.Ignore work for these signals. Fixes #12906. Change-Id: Iba244813051e0ce23fa32fbad3e3fa596a941094 Reviewed-on: https://go-review.googlesource.com/18348 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/signal_386.go')
-rw-r--r--src/runtime/signal_386.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/signal_386.go b/src/runtime/signal_386.go
index 5c53582f90..0374f4a2d7 100644
--- a/src/runtime/signal_386.go
+++ b/src/runtime/signal_386.go
@@ -107,6 +107,10 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
}
}
+ if c.sigcode() == _SI_USER && signal_ignored(sig) {
+ return
+ }
+
if flags&_SigKill != 0 {
dieFromSignal(int32(sig))
}