1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #42415 from thaJeztah/more_ignore

pkg/signal: ignore SIGURG on all platforms
This commit is contained in:
Akihiro Suda 2021-05-26 16:18:21 +09:00 committed by GitHub
commit c6134474c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 29 deletions

View file

@ -12,13 +12,13 @@ import (
) )
// CatchAll catches all signals and relays them to the specified channel. // CatchAll catches all signals and relays them to the specified channel.
// On Linux, SIGURG is not handled, as it's used by the Go runtime to support // SIGURG is not handled, as it's used by the Go runtime to support
// preemptable system calls. // preemptable system calls.
func CatchAll(sigc chan os.Signal) { func CatchAll(sigc chan os.Signal) {
var handledSigs []os.Signal var handledSigs []os.Signal
for _, s := range SignalMap { for n, s := range SignalMap {
if isRuntimeSig(s) { if n == "URG" {
// Do not handle SIGURG on Linux, as in go1.14+, the go runtime issues // Do not handle SIGURG, as in go1.14+, the go runtime issues
// SIGURG as an interrupt to support preemptable system calls on Linux. // SIGURG as an interrupt to support preemptable system calls on Linux.
continue continue
} }

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal" package signal // import "github.com/docker/docker/pkg/signal"
import ( import (
"os"
"syscall" "syscall"
) )
@ -40,7 +39,3 @@ var SignalMap = map[string]syscall.Signal{
"XCPU": syscall.SIGXCPU, "XCPU": syscall.SIGXCPU,
"XFSZ": syscall.SIGXFSZ, "XFSZ": syscall.SIGXFSZ,
} }
func isRuntimeSig(_ os.Signal) bool {
return false
}

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal" package signal // import "github.com/docker/docker/pkg/signal"
import ( import (
"os"
"syscall" "syscall"
) )
@ -42,7 +41,3 @@ var SignalMap = map[string]syscall.Signal{
"XCPU": syscall.SIGXCPU, "XCPU": syscall.SIGXCPU,
"XFSZ": syscall.SIGXFSZ, "XFSZ": syscall.SIGXFSZ,
} }
func isRuntimeSig(_ os.Signal) bool {
return false
}

View file

@ -3,7 +3,6 @@
package signal // import "github.com/docker/docker/pkg/signal" package signal // import "github.com/docker/docker/pkg/signal"
import ( import (
"os"
"syscall" "syscall"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
@ -82,7 +81,3 @@ var SignalMap = map[string]syscall.Signal{
"RTMAX-1": sigrtmax - 1, "RTMAX-1": sigrtmax - 1,
"RTMAX": sigrtmax, "RTMAX": sigrtmax,
} }
func isRuntimeSig(s os.Signal) bool {
return s == unix.SIGURG
}

View file

@ -4,7 +4,6 @@
package signal // import "github.com/docker/docker/pkg/signal" package signal // import "github.com/docker/docker/pkg/signal"
import ( import (
"os"
"syscall" "syscall"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
@ -83,7 +82,3 @@ var SignalMap = map[string]syscall.Signal{
"RTMAX-1": sigrtmax - 1, "RTMAX-1": sigrtmax - 1,
"RTMAX": sigrtmax, "RTMAX": sigrtmax,
} }
func isRuntimeSig(s os.Signal) bool {
return s == unix.SIGURG
}

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal" package signal // import "github.com/docker/docker/pkg/signal"
import ( import (
"os"
"syscall" "syscall"
) )
@ -25,7 +24,3 @@ var SignalMap = map[string]syscall.Signal{
"KILL": syscall.SIGKILL, "KILL": syscall.SIGKILL,
"TERM": syscall.SIGTERM, "TERM": syscall.SIGTERM,
} }
func isRuntimeSig(_ os.Signal) bool {
return false
}