1
0
mirror of https://github.com/docker/cli.git synced 2026-01-26 15:41:42 +03:00

Use a more idiomatic syntax to capture the exit.

Upstream-commit: 7cc90f2bc552f5b3b49e65e19ac877089e3db137
Component: engine
This commit is contained in:
David Calavera
2013-07-26 18:12:05 -07:00
parent 8a695e82cd
commit ca6c46031e

View File

@@ -319,12 +319,11 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
authconfig = auth.AuthConfig{}
}
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM)
go func() {
for sig := range c {
os.Exit(1)
}
<-sigchan
os.Exit(1)
}()
if *flUsername == "" {