Explorar o código

Remove unnecessary signal conditional.

David Calavera %!s(int64=12) %!d(string=hai) anos
pai
achega
c8ec36d1b9
Modificáronse 1 ficheiros con 4 adicións e 7 borrados
  1. 4 7
      commands.go

+ 4 - 7
commands.go

@@ -1658,14 +1658,11 @@ func (cli *DockerCli) monitorTtySize(id string) error {
 	}
 	cli.resizeTty(id)
 
-	c := make(chan os.Signal, 1)
-	signal.Notify(c, syscall.SIGWINCH)
+	sigchan := make(chan os.Signal, 1)
+	signal.Notify(sigchan, syscall.SIGWINCH)
 	go func() {
-		for sig := range c {
-			if sig == syscall.SIGWINCH {
-				cli.resizeTty(id)
-			}
-		}
+		<-sigchan
+		cli.resizeTty(id)
 	}()
 	return nil
 }