Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
This commit is contained in:
Mathieu Champlon 2021-09-16 15:46:27 +02:00
parent 3fb4fb83df
commit 8b85274d26
4 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
} }
if opts.proxy && !c.Config.Tty { if opts.proxy && !c.Config.Tty {
sigc := notfiyAllSignals() sigc := notifyAllSignals()
go ForwardAllSignals(ctx, dockerCli, opts.container, sigc) go ForwardAllSignals(ctx, dockerCli, opts.container, sigc)
defer signal.StopCatch(sigc) defer signal.StopCatch(sigc)
} }

View File

@ -131,7 +131,7 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
return runStartContainerErr(err) return runStartContainerErr(err)
} }
if opts.sigProxy { if opts.sigProxy {
sigc := notfiyAllSignals() sigc := notifyAllSignals()
go ForwardAllSignals(ctx, dockerCli, createResponse.ID, sigc) go ForwardAllSignals(ctx, dockerCli, createResponse.ID, sigc)
defer signal.StopCatch(sigc) defer signal.StopCatch(sigc)
} }

View File

@ -54,7 +54,7 @@ func ForwardAllSignals(ctx context.Context, cli command.Cli, cid string, sigc <-
} }
} }
func notfiyAllSignals() chan os.Signal { func notifyAllSignals() chan os.Signal {
sigc := make(chan os.Signal, 128) sigc := make(chan os.Signal, 128)
gosignal.Notify(sigc) gosignal.Notify(sigc)
return sigc return sigc

View File

@ -74,7 +74,7 @@ func runStart(dockerCli command.Cli, opts *startOptions) error {
// We always use c.ID instead of container to maintain consistency during `docker start` // We always use c.ID instead of container to maintain consistency during `docker start`
if !c.Config.Tty { if !c.Config.Tty {
sigc := notfiyAllSignals() sigc := notifyAllSignals()
go ForwardAllSignals(ctx, dockerCli, c.ID, sigc) go ForwardAllSignals(ctx, dockerCli, c.ID, sigc)
defer signal.StopCatch(sigc) defer signal.StopCatch(sigc)
} }