mirror of
https://github.com/moby/moby.git
synced 2025-12-24 13:21:20 +03:00
Extract client signals to pkg/signal
SIGCHLD and SIGWINCH used in api/client (cli code) are not available on Windows. Extracting into separate files with build tags. Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"text/tabwriter"
|
||||
"text/template"
|
||||
"time"
|
||||
@@ -608,7 +607,7 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
|
||||
signal.CatchAll(sigc)
|
||||
go func() {
|
||||
for s := range sigc {
|
||||
if s == syscall.SIGCHLD {
|
||||
if s == signal.SIGCHLD {
|
||||
continue
|
||||
}
|
||||
var sig string
|
||||
@@ -619,7 +618,7 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
|
||||
}
|
||||
}
|
||||
if sig == "" {
|
||||
log.Errorf("Unsupported signal: %d. Discarding.", s)
|
||||
log.Errorf("Unsupported signal: %v. Discarding.", s)
|
||||
}
|
||||
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/kill?signal=%s", cid, sig), nil, false)); err != nil {
|
||||
log.Debugf("Error sending signal: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user