From acb802996cfb7334889a7947d5631228902b8029 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Fri, 26 Jul 2013 18:12:05 -0700 Subject: [PATCH] Use a more idiomatic syntax to capture the exit. Upstream-commit: c3154fdf4d15aed049a9c18a36cc8511ed7e82c1 Component: engine --- components/engine/commands.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index 53f6706ae4..e078a97fd1 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -333,12 +333,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 == "" {