Kaynağa Gözat

beam/examples/beamsh: 'exec' command correctly closes stdout and stderr when the process exists

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Solomon Hykes 11 yıl önce
ebeveyn
işleme
5ddf673851
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      pkg/beam/examples/beamsh/beamsh.go

+ 2 - 0
pkg/beam/examples/beamsh/beamsh.go

@@ -214,6 +214,8 @@ func GetHandler(name string) Handler {
 				status = "ok"
 				status = "ok"
 			}
 			}
 			beam.Send(out, data.Empty().Set("status", status).Set("cmd", args...).Bytes(), nil)
 			beam.Send(out, data.Empty().Set("status", status).Set("cmd", args...).Bytes(), nil)
+			outW.Close()
+			errW.Close()
 		}
 		}
 	} else if name == "trace" {
 	} else if name == "trace" {
 		return func(args []string, in *net.UnixConn, out *net.UnixConn) {
 		return func(args []string, in *net.UnixConn, out *net.UnixConn) {