diff --git a/pkg/signal/signal.go b/pkg/signal/signal.go index bbe006bd0b..b274033ef6 100644 --- a/pkg/signal/signal.go +++ b/pkg/signal/signal.go @@ -12,13 +12,13 @@ import ( ) // 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. func CatchAll(sigc chan os.Signal) { var handledSigs []os.Signal - for _, s := range SignalMap { - if isRuntimeSig(s) { - // Do not handle SIGURG on Linux, as in go1.14+, the go runtime issues + for n, s := range SignalMap { + if n == "URG" { + // Do not handle SIGURG, as in go1.14+, the go runtime issues // SIGURG as an interrupt to support preemptable system calls on Linux. continue } diff --git a/pkg/signal/signal_darwin.go b/pkg/signal/signal_darwin.go index 8ffd3d73d3..ee5501e3d9 100644 --- a/pkg/signal/signal_darwin.go +++ b/pkg/signal/signal_darwin.go @@ -1,7 +1,6 @@ package signal // import "github.com/docker/docker/pkg/signal" import ( - "os" "syscall" ) @@ -40,7 +39,3 @@ var SignalMap = map[string]syscall.Signal{ "XCPU": syscall.SIGXCPU, "XFSZ": syscall.SIGXFSZ, } - -func isRuntimeSig(_ os.Signal) bool { - return false -} diff --git a/pkg/signal/signal_freebsd.go b/pkg/signal/signal_freebsd.go index a5e774a538..764f90e264 100644 --- a/pkg/signal/signal_freebsd.go +++ b/pkg/signal/signal_freebsd.go @@ -1,7 +1,6 @@ package signal // import "github.com/docker/docker/pkg/signal" import ( - "os" "syscall" ) @@ -42,7 +41,3 @@ var SignalMap = map[string]syscall.Signal{ "XCPU": syscall.SIGXCPU, "XFSZ": syscall.SIGXFSZ, } - -func isRuntimeSig(_ os.Signal) bool { - return false -} diff --git a/pkg/signal/signal_linux.go b/pkg/signal/signal_linux.go index 46fe6bbad0..4013bded13 100644 --- a/pkg/signal/signal_linux.go +++ b/pkg/signal/signal_linux.go @@ -3,7 +3,6 @@ package signal // import "github.com/docker/docker/pkg/signal" import ( - "os" "syscall" "golang.org/x/sys/unix" @@ -82,7 +81,3 @@ var SignalMap = map[string]syscall.Signal{ "RTMAX-1": sigrtmax - 1, "RTMAX": sigrtmax, } - -func isRuntimeSig(s os.Signal) bool { - return s == unix.SIGURG -} diff --git a/pkg/signal/signal_linux_mipsx.go b/pkg/signal/signal_linux_mipsx.go index 665d849adb..c78c887af5 100644 --- a/pkg/signal/signal_linux_mipsx.go +++ b/pkg/signal/signal_linux_mipsx.go @@ -4,7 +4,6 @@ package signal // import "github.com/docker/docker/pkg/signal" import ( - "os" "syscall" "golang.org/x/sys/unix" @@ -83,7 +82,3 @@ var SignalMap = map[string]syscall.Signal{ "RTMAX-1": sigrtmax - 1, "RTMAX": sigrtmax, } - -func isRuntimeSig(s os.Signal) bool { - return s == unix.SIGURG -} diff --git a/pkg/signal/signal_windows.go b/pkg/signal/signal_windows.go index d44662c4e4..65752f24aa 100644 --- a/pkg/signal/signal_windows.go +++ b/pkg/signal/signal_windows.go @@ -1,7 +1,6 @@ package signal // import "github.com/docker/docker/pkg/signal" import ( - "os" "syscall" ) @@ -25,7 +24,3 @@ var SignalMap = map[string]syscall.Signal{ "KILL": syscall.SIGKILL, "TERM": syscall.SIGTERM, } - -func isRuntimeSig(_ os.Signal) bool { - return false -}