go.mod: github.com/moby/sys/signal v0.6.0

full diff: https://github.com/moby/sys/compare/8a51b5cc8879...signal/v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
master
Sebastiaan van Stijn 2021-11-05 13:28:54 +01:00
parent 17a0e3ed12
commit 5b489dc25c
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
11 changed files with 20 additions and 19 deletions

2
go.mod
View File

@ -37,7 +37,7 @@ require (
github.com/mitchellh/hashstructure v1.0.0
github.com/moby/locker v1.0.1
github.com/moby/sys/mount v0.3.0 // indirect
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879
github.com/moby/sys/signal v0.6.0
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0
github.com/opencontainers/go-digest v1.0.0

3
go.sum
View File

@ -883,8 +883,9 @@ github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J
github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI=
github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU=
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879 h1:PkXi3ZKVBSfi1skhCjUykUKRwKxn/D48Nj4D1sWalXk=
github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879/go.mod h1:JwObcMnOrUy2VTP5swPKWwywH0Mbgk8Y5qua9iwtIRM=
github.com/moby/sys/signal v0.6.0 h1:aDpY94H8VlhTGa9sNYUFCFsMZIUh5wm0B6XkIoJj/iY=
github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=

View File

@ -39,13 +39,13 @@ func ParseSignal(rawSignal string) (syscall.Signal, error) {
s, err := strconv.Atoi(rawSignal)
if err == nil {
if s == 0 {
return -1, fmt.Errorf("Invalid signal: %s", rawSignal)
return -1, fmt.Errorf("invalid signal: %s", rawSignal)
}
return syscall.Signal(s), nil
}
signal, ok := SignalMap[strings.TrimPrefix(strings.ToUpper(rawSignal), "SIG")]
if !ok {
return -1, fmt.Errorf("Invalid signal: %s", rawSignal)
return -1, fmt.Errorf("invalid signal: %s", rawSignal)
}
return signal, nil
}

View File

@ -8,7 +8,7 @@ import (
var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM,
"BUG": syscall.SIGBUS,
"BUS": syscall.SIGBUS,
"CHLD": syscall.SIGCHLD,
"CONT": syscall.SIGCONT,
"EMT": syscall.SIGEMT,

View File

@ -8,7 +8,7 @@ import (
var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM,
"BUF": syscall.SIGBUS,
"BUS": syscall.SIGBUS,
"CHLD": syscall.SIGCHLD,
"CONT": syscall.SIGCONT,
"EMT": syscall.SIGEMT,

View File

@ -1,3 +1,4 @@
//go:build !mips && !mipsle && !mips64 && !mips64le
// +build !mips,!mipsle,!mips64,!mips64le
package signal

View File

@ -1,3 +1,4 @@
//go:build linux && (mips || mipsle || mips64 || mips64le)
// +build linux
// +build mips mipsle mips64 mips64le

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
package signal
@ -16,6 +17,4 @@ const (
SIGWINCH = syscall.SIGWINCH
// SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading
SIGPIPE = syscall.SIGPIPE
// DefaultStopSignal is the syscall signal used to stop a container in unix systems.
DefaultStopSignal = "SIGTERM"
)

View File

@ -1,3 +1,4 @@
//go:build !linux && !darwin && !freebsd && !windows
// +build !linux,!darwin,!freebsd,!windows
package signal

View File

@ -12,25 +12,23 @@ const (
SIGCHLD = syscall.Signal(0xff)
SIGWINCH = syscall.Signal(0xff)
SIGPIPE = syscall.Signal(0xff)
// DefaultStopSignal is the syscall signal used to stop a container in windows systems.
DefaultStopSignal = "15"
)
// SignalMap is a map of "supported" signals. As per the comment in GOLang's
// ztypes_windows.go: "More invented values for signals". Windows doesn't
// really support signals in any way, shape or form that Unix does.
var SignalMap = map[string]syscall.Signal{
"HUP": syscall.Signal(windows.SIGHUP),
"INT": syscall.Signal(windows.SIGINT),
"QUIT": syscall.Signal(windows.SIGQUIT),
"ILL": syscall.Signal(windows.SIGILL),
"TRAP": syscall.Signal(windows.SIGTRAP),
"ABRT": syscall.Signal(windows.SIGABRT),
"ALRM": syscall.Signal(windows.SIGALRM),
"BUS": syscall.Signal(windows.SIGBUS),
"FPE": syscall.Signal(windows.SIGFPE),
"HUP": syscall.Signal(windows.SIGHUP),
"ILL": syscall.Signal(windows.SIGILL),
"INT": syscall.Signal(windows.SIGINT),
"KILL": syscall.Signal(windows.SIGKILL),
"SEGV": syscall.Signal(windows.SIGSEGV),
"PIPE": syscall.Signal(windows.SIGPIPE),
"ALRM": syscall.Signal(windows.SIGALRM),
"QUIT": syscall.Signal(windows.SIGQUIT),
"SEGV": syscall.Signal(windows.SIGSEGV),
"TERM": syscall.Signal(windows.SIGTERM),
"TRAP": syscall.Signal(windows.SIGTRAP),
}

4
vendor/modules.txt vendored
View File

@ -377,8 +377,8 @@ github.com/moby/sys/mount
# github.com/moby/sys/mountinfo v0.5.0
## explicit; go 1.16
github.com/moby/sys/mountinfo
# github.com/moby/sys/signal v0.5.1-0.20210723232958-8a51b5cc8879
## explicit; go 1.13
# github.com/moby/sys/signal v0.6.0
## explicit; go 1.16
github.com/moby/sys/signal
# github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
## explicit; go 1.13