summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers_remote.go
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-07-23 11:16:34 -0400
committerPeter Hunt <pehunt@redhat.com>2019-07-23 13:30:15 -0400
commit9e6928570459ba5451f2128a9391bbb48acefc1e (patch)
treeabf4d969412be3590192a47768a4357c454311dc /pkg/adapter/containers_remote.go
parent74ab273e919715823fe9bb70c030a65b021897d1 (diff)
downloadpodman-9e6928570459ba5451f2128a9391bbb48acefc1e.tar.gz
podman-9e6928570459ba5451f2128a9391bbb48acefc1e.tar.bz2
podman-9e6928570459ba5451f2128a9391bbb48acefc1e.zip
only use stdin if specified
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r--pkg/adapter/containers_remote.go24
1 files changed, 11 insertions, 13 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go
index 0373913d0..751c184b3 100644
--- a/pkg/adapter/containers_remote.go
+++ b/pkg/adapter/containers_remote.go
@@ -1057,12 +1057,8 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
ecChan := make(chan int, 1)
errChan := configureVarlinkAttachStdio(r.Conn.Reader, r.Conn.Writer, inputStream, os.Stdout, oldTermState, resize, ecChan)
- select {
- case ec = <-ecChan:
- break
- case err = <-errChan:
- break
- }
+ ec = <-ecChan
+ err = <-errChan
return ec, err
}
@@ -1095,13 +1091,15 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
}
}()
- // Takes stdinput and sends it over the wire after being encoded
- go func() {
- if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil {
- defer restoreTerminal(oldTermState)
- errChan <- err
- }
+ if stdin != nil {
+ // Takes stdinput and sends it over the wire after being encoded
+ go func() {
+ if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil {
+ defer restoreTerminal(oldTermState)
+ errChan <- err
+ }
- }()
+ }()
+ }
return errChan
}