]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: set SIGCONT to _SigNotify + _SigDefault
authorIan Lance Taylor <iant@golang.org>
Thu, 31 Dec 2015 20:06:31 +0000 (12:06 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Jan 2016 17:44:46 +0000 (17:44 +0000)
Use the current ability to say that we don't do anything with SIGCONT by
default, but programs can catch it using signal.Notify if they want.

Fixes #8953.

Change-Id: I67d40ce36a029cbc58a235cbe957335f4a58e1c5
Reviewed-on: https://go-review.googlesource.com/18185
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/signal/signal_test.go
src/runtime/signal_darwin.go
src/runtime/signal_dragonfly.go
src/runtime/signal_freebsd.go
src/runtime/signal_nacl.go
src/runtime/signal_netbsd.go
src/runtime/signal_openbsd.go
src/runtime/signal_solaris.go
src/runtime/sigtab_linux_generic.go
src/runtime/sigtab_linux_mips64x.go

index 7942e78752a28f548bd4bd3e07a0fa7c96caac75..291c5f113e4aa579d6a103a639a21d5fe7252466 100644 (file)
@@ -278,3 +278,12 @@ func TestNohup(t *testing.T) {
                }
        }
 }
+
+// Test that SIGCONT works (issue 8953).
+func TestSIGCONT(t *testing.T) {
+       c := make(chan os.Signal, 1)
+       Notify(c, syscall.SIGCONT)
+       defer Stop(c)
+       syscall.Kill(syscall.Getpid(), syscall.SIGCONT)
+       waitSig(t, c, syscall.SIGCONT)
+}
index 142f4e24ce5d7411dc5807e4307a154dcaa6d2f8..4a26f3eb08a97ab5b6eee72402ac8da0675411c1 100644 (file)
@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index d37e11a3ecc0b5c12f843073ab09fe86072bfc37..f507a07233c6034858ac647424d91c1e86dd8b52 100644 (file)
@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index bc167c7a9a4689f96acfc3a01ad6c81eeb3a11c8..7c98cf372bddc22b7ef9b2b29bdf49b7b9237119 100644 (file)
@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index 122648bc334072a458a6bee8b82708898bb26a16..47930757da84dc9efdaddba03890225695595685 100644 (file)
@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index d93a450d987c30a2a0cdaad00f5107354e1a5b93..30a3b8e1a922b3d1b6659e213750c74ee469663a 100644 (file)
@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index f724db9fcdfbac4a6692f8f00e498b5848eb0263..d1e48c43fc1017b77ed01c7bca92ffef5238b253 100644 (file)
@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
        /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
        /* 17 */ {0, "SIGSTOP: stop"},
        /* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 19 */ {0, "SIGCONT: continue after stop"},
+       /* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
        /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
index 04b5c9dba6978af0497f11cbe89b8b57a59783cb..2cab5b823902b4aec0c25627e6ca60f660f52d60 100644 (file)
@@ -35,7 +35,7 @@ var sigtable = [...]sigTabT{
        /* 22 */ {_SigNotify, "SIGPOLL: pollable event occured"},
        /* 23 */ {_SigNotify + _SigDefault, "SIGSTOP: stop (cannot be caught or ignored)"},
        /* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: user stop requested from tty"},
-       /* 25 */ {0, "SIGCONT: stopped process has been continued"},
+       /* 25 */ {_SigNotify + _SigDefault, "SIGCONT: stopped process has been continued"},
        /* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background tty read attempted"},
        /* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background tty write attempted"},
        /* 28 */ {_SigNotify, "SIGVTALRM: virtual timer expired"},
index 839d52671a74f67c5e22839434fab63b55d67ed5..32c40c4768eb2722159f133ed15e136032f4b6ff 100644 (file)
@@ -32,7 +32,7 @@ var sigtable = [...]sigTabT{
        /* 15 */ {_SigNotify + _SigKill, "SIGTERM: termination"},
        /* 16 */ {_SigThrow + _SigUnblock, "SIGSTKFLT: stack fault"},
        /* 17 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
-       /* 18 */ {0, "SIGCONT: continue"},
+       /* 18 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
        /* 19 */ {0, "SIGSTOP: stop, unblockable"},
        /* 20 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
        /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
index 2c0003f72b85b9f2956675ea2a247648a9b78a1d..dbd50f7b1f62b2cfd09d00d2c0dbffa35c5bda76 100644 (file)
@@ -38,7 +38,7 @@ var sigtable = [...]sigTabT{
        /* 22 */ {_SigNotify, "SIGIO: i/o now possible"},
        /* 23 */ {0, "SIGSTOP: stop, unblockable"},
        /* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
-       /* 25 */ {0, "SIGCONT: continue"},
+       /* 25 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
        /* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
        /* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
        /* 28 */ {_SigNotify, "SIGVTALRM: virtual alarm clock"},